Last active
August 8, 2022 05:07
-
-
Save thuycom205/a1f58c7db7893ea19e22d392ba09cd2c 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
#odoo server | |
upstream odoo { | |
server 127.0.0.1:8069; | |
} | |
upstream odoochat { | |
server 127.0.0.1:8072; | |
} | |
# http -> https | |
server { | |
listen 80; | |
server_name app.thexseed.com; | |
rewrite ^(.*) https://$host$1 permanent; | |
} | |
server { | |
listen 443 ssl; | |
server_name app.thexseed.com; | |
proxy_read_timeout 720s; | |
proxy_connect_timeout 720s; | |
proxy_send_timeout 720s; | |
# Add Headers for odoo proxy mode | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Odoo-dbfilter "odooseed"; | |
# SSL parameters | |
ssl_certificate /etc/letsencrypt/live/app.thexseed.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/app.thexseed.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
# log | |
access_log /var/log/nginx/odoo.access.log; | |
error_log /var/log/nginx/odoo.error.log; | |
# Redirect longpoll requests to odoo longpolling port | |
location /longpolling { | |
proxy_pass http://odoochat; | |
} | |
# Redirect requests to odoo backend server | |
location / { | |
proxy_redirect off; | |
proxy_pass http://odoo; | |
} | |
# common gzip | |
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript; | |
gzip on; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment