我正在尝试让反向代理工作。我遵循了以下操作
https://github.com/nthnnl/odoo-nginx-reverse-proxy
I am getting ginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/mysite.com.conf:52
这是启用站点的文件
upstream odoo {
server 127.0.0.1:8069;
}
server {
listen 443 default;
server_name www.YOURDOMAIN.COM;
access_log /var/log/nginx/oddo.access.log;
error_log /var/log/nginx/oddo.error.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/www.YOURDOMAIN.COM/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.YOURDOMAIN.COM/privkey.pem;
keepalive_timeout 60;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-$
ssl_prefer_server_ciphers on;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
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 ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
}
server {
listen 80;
server_name www.YOURDOMAIN.COM;
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://$host$request_uri? permanent;
}
答案1
您的ssl_ciphers
行无效,该行以 结尾$
,而不是';
应以 结尾。
之前的最后一个元素$
也是不完整的。