我想重新配置我的NGINX安裝代理到本地ghost安裝。NGINX - 「服務器」指令不允許在這裏
除此之外,我添加SSL(letsencrypt),但我不斷收到錯誤。
我得到的錯誤是 -
nginx -t -c /etc/nginx/sites-available/ghost
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-available/ghost:1
nginx: configuration file /etc/nginx/sites-available/ghost test failed
這裏是我的配置
server {
listen 80;
server_name domainnamehere.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443;
server_name www.nonstopdev.com;
access_log /var/log/nginx/domainnamehere.com.access.log;
error_log /var/log/nginx/domainnamehere.com.error.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/domainnamehere.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domainnamehere.com/privkey.pem;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
以下配置工作正常,沒有任何的起訴 -
server {
listen 80;
server_name mydomainname.com;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
更新了可以工作的配置 - 但沒有SSL ... – mutantChickenHer0