Skip to content

Instantly share code, notes, and snippets.

@songpon
Created August 30, 2018 08:42
Show Gist options
  • Save songpon/ee74a43b0990a828067f0313a647733d to your computer and use it in GitHub Desktop.
Save songpon/ee74a43b0990a828067f0313a647733d to your computer and use it in GitHub Desktop.
# Reference
# https://www.linuxcloudvps.com/blog/how-to-install-odoo-10-on-ubuntu-16-04-with-nginx-as-a-reverse-proxy/
# https://linuxize.com/post/configure-odoo-with-nginx-as-a-reverse-proxy/
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoo-chat {
server 127.0.0.1:8072;
}
server {
listen 80 default;
server_name mysite.com;
access_log /var/log/nginx/mysite.com.access.log;
error_log /var/log/nginx/mysite.com.error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
# gzip : https://checkgzipcompression.com/
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
location / {
proxy_pass http://odoo;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_set_header Host $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 https;
}
location /longpolling {
proxy_pass http://odoo-chat;
}
location ~* /web/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