Created
August 20, 2017 21:04
nginx configuration for odoo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_rlimit_nofile 1024; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
error_log /var/log/nginx/error.log; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
server_tokens on; | |
types_hash_max_size 1024; | |
types_hash_bucket_size 512; | |
server_names_hash_bucket_size 64; | |
server_names_hash_max_size 512; | |
keepalive_timeout 65; | |
tcp_nodelay on; | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_proxied any; | |
gzip_min_length 500; | |
gzip_disable "MSIE [1-6]\."; | |
gzip_types text/plain text/xml text/css | |
text/comma-separated-values | |
text/javascript | |
application/json | |
application/xml | |
application/x-javascript | |
application/javascript | |
application/atom+xml; | |
proxy_redirect off; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 90; | |
proxy_read_timeout 90; | |
proxy_buffers 32 4k; | |
proxy_buffer_size 8k; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_set_header X-Forwarded-Host $http_host; | |
proxy_headers_hash_bucket_size 64; | |
# List of application servers | |
upstream odoo { | |
server 127.0.0.1:8069; | |
} | |
upstream odoochat { | |
server 127.0.0.1:8072; | |
} | |
# Configuration for the server | |
server { | |
listen 80 default; | |
client_max_body_size 1G; | |
add_header Strict-Transport-Security "max-age=31536000"; | |
location / { | |
proxy_pass http://odoo; | |
proxy_read_timeout 6h; | |
proxy_connect_timeout 5s; | |
proxy_redirect off; | |
add_header X-Static no; | |
proxy_buffer_size 64k; | |
proxy_buffering off; | |
proxy_buffers 4 64k; | |
proxy_busy_buffers_size 64k; | |
proxy_intercept_errors on; | |
} | |
location /longpolling/im/poll { proxy_pass http://odoochat; } | |
location /longpolling/poll { proxy_pass http://odoochat; } | |
location ~* /[^/]+/static/ { | |
proxy_cache_valid 200 60m; | |
proxy_buffering on; | |
expires 864000; | |
proxy_pass http://odoo; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment