Skip to Content
Menu
This question has been flagged
1 Reply
8474 Views

   Basically, if I want to monitor the attendance of my employee I go to the attendance app there. All employees are able to just check in and check out. If employee is absent, they still can log in at home and do check in.

How to block employee from accessing the attendance app when not in internal network?

My setup is using dynamic DNS -> reverse proxy, nginx. Can I block this access via nginx ? Currently my nginx configuration file is like this:

#odoo server

upstream odoo {

server 127.0.0.1:8069;

}

upstream odoochat {

server 127.0.0.1:8072;

}

# http -> https

server {

listen 80 default_server;

listen [::]:80 default_server;

server_name example.com www.example.com;

return 301 https://www.example.com$request_uri;

}

server {

# SSL configuration

listen 443 ssl http2 default_server;

listen [::]:443 ssl http2 default_server;

server_name example.com www.example.com;

if ($http_host = 'example.com')

{

return 301 https://www.example.com$request_uri;

}

proxy_read_timeout 720s;

proxy_connect_timeout 720s;

proxy_send_timeout 720s;

# Add Headers for odoo proxy mode

proxy_set_header X-Forwarded-Host $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_set_header X-Real-IP $remote_addr;

#SSL

include snippets/ssl-example.com.conf;

include snippets/ssl-params.conf;

    # log

access_log /var/log/nginx/odoo.access.log;

error_log /var/log/nginx/odoo.error.log;

# Redirect longpoll requests to odoo longpolling port

location /longpolling {

proxy_pass http://odoochat;

}

# Redirect requests to odoo backend server

location / {

proxy_redirect off;

proxy_pass http://odoo;

# set headers

# ...

location ~ /web/database/manager {

auth_basic "Restricted Content";

auth_basic_user_file /etc/nginx/.htpasswd;

proxy_pass http://localhost:8069;

# set headers

}

location ~ /web/database/selector {

auth_basic "Restricted Content";

auth_basic_user_file /etc/nginx/.htpasswd;

proxy_pass http://localhost:8069;

# set headers

}

}

# common gzip

gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;

gzip on;

}

What is the best method for my situation? Thanks


Avatar
Discard
Best Answer

Hai Arafat Ali,

    You can yous this module to restrict the IP. 

"Access Restriction By IP"https://www.odoo.com/apps/modules/10.0/access_restriction_by_ip/

This module will restrict the users access to his account from specified IP address only. it may help you thanks.

Avatar
Discard
Author

Hai, I only want to block one module. Employee can access everything else outside. So this module is not fit the case.

Author

I only wantto block the attendance module where logically, employee can only access the module inside a premise not at home to take attendance. Any help appreciate.

I tried configure the nginx file but doesn't seems to work because the URL to the module has anchor and variable.

Related Posts Replies Views Activity
1
May 23
333
2
Nov 24
267
1
Oct 24
335
4
Oct 24
325
2
Oct 24
362