配置参考:

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;
}


点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部