
我的 nginx 设置如下:
server { listen 80 default_server; listen 443 default; ssl on; ssl_certificate /root/certificate.crt; ssl_certificate_key /root/private.key; server_name _; return 403; } server { listen 443; listen 80; server_name example.com www.example.com; ssl on; ssl_certificate /root/certificate.crt; ssl_certificate_key /root/private.key; location ~ \.php$ { proxy_pass http://localhost:800; } error_page 497 https://$host$uri?$args; } 我这样写的目的是阻止用 IP 直接访问以及强制使用 https 访问网页,想的是利用反向代理,使得连接到 nginx 用 https,然后服务器内部是直接转到 httpd 的 800 端口。但是有一个问题在于浏览器的安全策略会认为 httpd 里的 http 静态资源不安全,从而拒绝访问,如下图:
我想问一下能像我设想的那样连到 nginx 是 https,然后内部的转发用 http 吗?该如何设置,谢谢
1 Showfom PRO 这和你 nginx 没关系啊 你 WP 的 URL 设置 |
2 zuolan 2017-07-12 16:25:20 +08:00 看起来是 wp 没有设置域名吧? |
3 msg7086 2017-07-12 16:32:50 +08:00 网页上的链接和你用的服务器没关系 = = |
4 lslqtz 2017-07-13 11:36:07 +08:00 https 引入 http 的链接不报错才怪 这是常识了吧? |