Last active
September 20, 2016 10:14
-
-
Save lukebranch/24ce7710feda5d1c78b0821d86edd38e to your computer and use it in GitHub Desktop.
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
# BASED ON - http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/ | |
upstream odoo8swi { | |
server localhost:8069 weight=1 fail_timeout=3000; | |
} | |
upstream odoo8swi-im { | |
server localhost:8072 weight=1 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
listen [::]:80 ipv6only=on; | |
server_name mydomainname.com; | |
## ODOO-Specific Settings | |
# Specifies the maximum accepted body size of a client request, | |
# as indicated by the request header Content-Length. | |
client_max_body_size 1000m; | |
# add ssl specific settings | |
keepalive_timeout 60; | |
# increase proxy buffer to handle some OpenERP web requests | |
proxy_buffers 16 64k; | |
proxy_buffer_size 128k; | |
#general proxy settings | |
# force timeouts if the backend dies | |
proxy_connect_timeout 600s; | |
proxy_send_timeout 600s; | |
proxy_read_timeout 600s; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; | |
# set headers | |
proxy_set_header Host $host; | |
# proxy_set_header X-Forwarded-Host mydomainname.com; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
# proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-ODOO-dbfilter SWI; | |
# Lasley Suggested Headers | |
port_in_redirect off; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# proxy_set_header Front-End-Https On; | |
## proxy_set_header X-Real-IP $remote_addr; | |
# by default, do not forward anything | |
proxy_redirect off; | |
proxy_buffering off; | |
location / { | |
proxy_pass http://odoo8swi; | |
} | |
location /longpolling { | |
proxy_pass http://odoo8swi-im; | |
} | |
# 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://odoo8swi; | |
# autoindex on; | |
} | |
access_log /var/log/nginx/mydomainname.com.access.log; | |
access_log /var/log/nginx/mydomainname.com.apachestyle.access.log; | |
error_log /var/log/nginx/mydomainname.com.error.log; | |
location ~ ^/web/database/(manager|selector) { | |
deny all; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment