要在http://erp.my-odoo.com
处打开Odoo,我应该在以下(几乎)默认Nginx配置中进行哪些更改,知道我已经将DNS erp.my-odoo.com
设置为指向{{1 }}?
192.168.0.10
/etc/nginx/conf.d/odoo.conf
此配置给我以下错误:
# Odoo Upstreams
upstream odooserver {
server erp.my-odoo.com:8069;
}
server {
listen 80;
server_name erp.my-odoo.com;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;
# Proxy settings
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
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;
# Request for root domain
location / {
proxy_redirect off;
proxy_pass http://odooserver;
}
# Cache static files
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odooserver;
}
# Gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
答案 0 :(得分:2)
确保主机erp.my-odoo.com
是可以由运行nginx的服务器解析的,或者如果nginx与Odoo应用程序在同一服务器上运行,则可以将上游更改为localhost
或127.0.0.1
。
upstream odooserver {
server 127.0.0.1:8069;
}