我设法用没有错误的LE创建了我的证书,我也设法将流量从端口80重定向到端口443。但是,当我重新加载nginx服务器时,我无法访问我的网站。Ngnix错误日志显示以下行:
4 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: 192.168.0.104, server: 0.0.0.0:443
我认为这意味着它找不到我随后导航到证书路径的证书,而且它们都在那儿,这可能是什么问题?这是我的Ngnix配置的样子:
server {
listen 80;
server_name pumaportal.com www.pumaportal.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name pumaportal.com www.pumaportal.com;
add_header Strict-Transport-Security "max-age=31536000";
ssl_certificate /etc/letsencrypt/live/pumaportal.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pumaportal.com/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
access_log /var/log/nginx/sub.log combined;
location /.well-known {
alias /[MY PATH]/.well-known;
}
location / {
proxy_pass http://localhost:2000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
一切似乎很简单,我不知道问题可能在哪里。
运行nginx -t之后,一切似乎都还可以:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
server
街区吗?遇到错误时,您到底做了什么?