配置参考:
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
listen [::]:80;
server_name odoo16.xiaoniba.com erp6.xnb.me erp.xiaoniba.com;
# Redirect HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name odoo16.xiaoniba.com erp6.xnb.me erp.xiaoniba.com;
# SSL Certificate
ssl_certificate /etc/nginx/cert/erp.xiaoniba.com/cert.pem;
ssl_certificate_key /etc/nginx/cert/erp.xiaoniba.com/key.pem;
# Proxy settings
location / {
proxy_pass http://odoo;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /longpolling {
proxy_pass http://odoochat;
}
# Common gzip settings
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
# Access and error logs
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
}
发表评论 取消回复