62 lines
1.6 KiB
Nginx Configuration File
62 lines
1.6 KiB
Nginx Configuration File
# Define a server for odoo backend (port 8069, as configured on the odoo.conf file (odoo file) )
|
|
upstream odoo-backend {
|
|
server odoo:8069;
|
|
}
|
|
|
|
# Define a server for longpolling (port 8072, as configured on the odoo.conf file (odoo file) )
|
|
upstream odoo-lp{
|
|
server odoo:8072;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
# Log files
|
|
access_log /var/log/nginx/odoo-access.log;
|
|
error_log /var/log/nginx/odoo-error.log;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Proxy header and settings
|
|
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;
|
|
client_max_body_size 10000m;
|
|
|
|
# Increase proxy buffer size
|
|
proxy_buffers 16 64k;
|
|
proxy_buffer_size 128k;
|
|
# Force timeouts if the backend dies
|
|
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
|
|
# Enable data compression
|
|
gzip on;
|
|
gzip_min_length 1100;
|
|
gzip_buffers 4 32k;
|
|
gzip_types text/plain text/xml text/css text/less application/x-javascript application/xml application/json application/javascript;
|
|
gzip_vary on;
|
|
|
|
# Cache static data
|
|
location ~* /web/static/ {
|
|
proxy_cache_valid 200 60m;
|
|
proxy_buffering on;
|
|
expires 864000;
|
|
proxy_pass http://odoo-backend;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://odoo-backend;
|
|
# The following makes the timeout broader
|
|
proxy_read_timeout 30000;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
location /longpolling {
|
|
proxy_pass http://odoo-lp;
|
|
}
|
|
}
|