技术解析
我的 nginx 配置
server {
listen 80;
listen 443 ssl;
server_name 118.89.143.159;
ssl on;
ssl_c国外服务器ertificate /etc/nginx/1_www.xilixjd.cc_bundle.crt;
ssl_certificate_key /etc/nginx/2_www.xilixjd.cc.key;
location /api {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://0.0.0.0:5000/api;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
root /home/ubuntu/python_react_blog/python_react_blog_front_end;
index index.html index.htm;
}
location /socket.io {
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://0.0.0.0:5000/socket.io;
}
}
各位可以访问一下 https://www.xilixjd.cc
接口数据加载不出来
浏览器右键检查 Network 接口显示 Referrer Policy: no-referrer-when-downgrade
另外还想问一下
1.如果想让访问 http://www.xilixjd.cc 的时候跳转到 https 应该怎么实现
2.网址不带 www 访问 xilixjd.cc 的时候也能跳转到 https 完整网址