74 lines
2.1 KiB
Nginx Configuration File
74 lines
2.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name erp.[DOMAIN];
|
|
|
|
# Redirect HTTP to HTTPS
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name erp.[DOMAIN];
|
|
|
|
ssl_certificate /etc/letsencrypt/live/erp.[DOMAIN]/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/erp.[DOMAIN]/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
# Upload di allegati/import di grandi dimensioni
|
|
client_max_body_size 200M;
|
|
|
|
# Re-resolve odoo's DNS name at request time so a container restart
|
|
# (new IP on internal.network) doesn't leave nginx stuck on a stale
|
|
# address until nginx itself is restarted.
|
|
resolver 10.10.0.1 valid=10s;
|
|
resolver_timeout 5s;
|
|
|
|
# Longpolling / bus (notifiche realtime, gevent sulla porta 8072)
|
|
location /websocket {
|
|
set $odoo_bus_upstream http://odoo:8072;
|
|
proxy_pass $odoo_bus_upstream;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_read_timeout 3600;
|
|
proxy_send_timeout 3600;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
# Odoo web (porta 8069)
|
|
location / {
|
|
set $odoo_upstream http://odoo:8069;
|
|
proxy_pass $odoo_upstream;
|
|
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
proxy_redirect off;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
proxy_read_timeout 3600;
|
|
proxy_send_timeout 3600;
|
|
}
|
|
|
|
# Logging
|
|
access_log /var/log/nginx/odoo_access.log;
|
|
error_log /var/log/nginx/odoo_error.log;
|
|
}
|