【发布时间】:2021-09-03 01:40:54
【问题描述】:
我在 /etc/nginx/sites-avaible 有一个配置。我的项目在 3010 端口上工作。我将我的域 dns 重定向到 cloudflare,激活到 SSL。但我无法联系到https://domain.xyz。 我是 devops 的新手。
upstream zapbot.xyz {
server 127.0.0.1:3010;
keepalive 8;
}
server {
listen 80;
listen [::]:80;
server_name zapbot.xyz www.zapbot.xyz;
access_log /var/log/nginx/zapbot.xyz.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://zapbot.xyz/;
proxy_redirect off;
}
}
【问题讨论】:
-
在 cloudflare 上您是否使用了“ssl > full”选项?您可能还需要在端口 443 上添加监听。您可以通过在 couldflare 上将“完整”更改为“灵活”来测试它,这将使 cloudflare 在 nginx 中的端口 80 上与您的站点通信。
-
嗨,Cargrison,您能否确认这是否解决了您的问题?如果是,@sur.la.route 请将此作为您的答案,以便可以将此问题标记为已回答并关闭...
标签: ubuntu nginx ssl cloudflare