51 lines
1.5 KiB
Nginx Configuration File
51 lines
1.5 KiB
Nginx Configuration File
upstream odoo-server {
|
|
server 127.0.0.1:8069 fail_timeout=3000s;
|
|
}
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
server_name _;
|
|
|
|
|
|
# Specifies the maximum accepted body size of a client request,
|
|
# as indicated by the request header Content-Length.
|
|
client_max_body_size 200m;
|
|
|
|
# log files
|
|
access_log /var/log/nginx/odoo-access.log;
|
|
error_log /var/log/nginx/odoo-error.log;
|
|
|
|
# increase proxy buffer to handle some OpenERP web requests
|
|
proxy_buffers 16 64k;
|
|
proxy_buffer_size 128k;
|
|
|
|
location / {
|
|
proxy_pass http://odoo-server;
|
|
# force timeouts if the backend dies
|
|
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
|
|
proxy_read_timeout 300s;
|
|
|
|
# set headers
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
|
|
|
|
# Let the OpenERP web service know that we're using HTTPS, otherwise
|
|
# it will generate URL using http:// and not https://
|
|
# proxy_set_header X-Forwarded-Proto https;
|
|
|
|
# by default, do not forward anything
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# cache some static data in memory for 60mins.
|
|
# under heavy load this should relieve stress on the OpenERP web interface a bit.
|
|
location ~* /web/static/ {
|
|
proxy_cache_valid 200 60m;
|
|
proxy_buffering on;
|
|
expires 864000;
|
|
proxy_pass http://odoo-server;
|
|
}
|
|
|
|
}
|