如何解决HTTPS 站点未在浏览器中显示,谷歌计算引擎、django、nginx、gunicorn、让加密、谷歌域也不例外
我对谷歌计算引擎以及使用 Django 的 gunicorn 和 nginx 比较陌生。 问题是我没有收到任何例外,但我的网站没有托管。 我使用过 django、gunicorn、nginx、certbot/letsencrypt、google 域。 在我添加 google 域和 certbot 之前,该站点只使用了 gunicorn 和 nginx。现在我通过浏览器什么也得不到。我无法判断问题是什么,因为我在日志中看不到任何内容。我查看了类似问题的部分答案,但似乎没有任何效果,并且我尝试查看多篇设置文章。好像找不到问题。
NGINX 设置:
server {
server_name <domain-name.com> <www.domain-name.com> ;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/ij/djangoapp1;
}
location /media/ {
root /home/ij/djangoapp1;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/<domain-name.com> /fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/<domain-name.com> /privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log;
}
server {
if ($host = <www.domain_name.com>) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = <domain-name.com> ) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name <external_ip> <domain-name.com> <www.domain_name.com>;
return 404; # managed by Certbot
netstat -tulpn |听听:
(No info could be read for "-p": geteuid()=1003 but you should be root.)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
防火墙规则:
https-outgoing Egress Apply to all IP ranges: 0.0.0.0/0 tcp:443 Allow 1000 default On 3
local Egress Apply to all IP ranges: <internal ip> all Allow 1000 default On 0 No hits
outgoingport Egress Apply to all IP ranges: 0.0.0.0/0 tcp:3000-3999 Allow 1000 default Off— —
allow443 Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:443 Allow 1000 default On 0 No hits
default-allow-http Ingress http-server IP ranges: 0.0.0.0/0 tcp:80 Allow 1000 default Off — —
default-allow-http-3000 Ingress http-server IP ranges: 0.0.0.0/0 tcp:3000-3010 Allow 1000 default Off — —
default-allow-http-8080 Ingress http-server IP ranges: 0.0.0.0/0 tcp:8080 Allow 1000 default Off — —
default-allow-https Ingress https-server IP ranges: 0.0.0.0/0 tcp:443 Allow 1000 default Off — —
default-allow-ip-http-3000 Ingress http-server IP ranges: <internal_ip> tcp:3000-3010 Allow 1000 default Off — —
default-allow2 Ingress Apply to all IP ranges: <internal_ip> all Allow 1000 default On 0 No hits
django8000 Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:8000 Allow 1000 default On 23
jupyternotebook Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:8888 Allow 1000 default On 18
local-new-internal Ingress Apply to all IP ranges: <internal_ip> all Allow 1000 default On 0 No hits
myrule1 Ingress tag1 IP ranges: 0.0.0.0/0 tcp:3004,3005 Allow 1000 default Off — —
myrule2 Ingress tag1 IP ranges: 0.0.0.0/0 tcp:3000-3011 Allow 1000 default Off — —
nginx-plus-http-fw-rule Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:80,8080,443 Allow 1000 default On 3862 2021-01-26
default-allow-icmp Ingress Apply to all IP ranges: 0.0.0.0/0 icmp Allow 65534 default Off — —
default-allow-internal Ingress Apply to all IP ranges: <internal ip> /9 tcp:0-65535 udp:0-65535 icmp Allow 65534 default Off — —
default-allow-rdp Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:3389 Allow 65534 default Off — —
default-allow-ssh Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:22 Allow 65534 default Off — —
NGINX 错误日志似乎没有显示任何内容:
/var/log/nginx$ sudo tail error.log
2021/01/25 12:50:49 [notice] 12639#12639: signal process started
2021/01/25 12:51:07 [notice] 12655#12655: signal process started
2021/01/25 12:54:55 [notice] 12772#12772: signal process started
2021/01/25 12:55:08 [notice] 12779#12779: signal process started
2021/01/25 12:55:11 [notice] 12783#12783: signal process started
2021/01/25 12:57:12 [notice] 12842#12842: signal process started
2021/01/25 13:03:18 [notice] 12942#12942: signal process started
2021/01/25 20:06:13 [notice] 1240#1240: signal process started
2021/01/25 20:21:33 [notice] 1578#1578: signal process started
2021/01/25 21:15:52 [notice] 2607#2607: signal process started
解决方法
最奇怪的事情解决了它。我重新启动了我的电脑,因此重新启动了 VPN 并随后进入该站点并且它工作正常。这是在尝试从头开始重建它的一天之后。我不知道为什么会这样。我正在使用 safari 浏览器,但也安装了 Firefox,直到我重新启动它才起作用。清除cookies?就这么简单吗?我真的不明白为什么会这样。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。