如何解决nginx:nginx混合内容已通过HTTPS加载
我们在kubernetes中将nginx用作代理密码:
pod -> service -> nginx -> ingress
例如,当我们打开一个URL-“ https://acme-node1.example.com”时,nginx会将“ acme”标识为pod名称,而“ -node1”则属于端口“ 8080”,最终执行代理通过反向,但是,我们遇到了一个问题
Mixed Content: The page at 'https://acme-node1.example.com/navpage.do' was loaded over HTTPS,but requested an insecure form action 'http://acme-node1.example.com/login_redirect.do?sysparm_stack=no'. This request has been blocked; the content must be served over HTTPS.
下面是nginx conf文件的详细信息(存储在conf.d下),请确认是否有任何要纠正的内容以解决“混合内容...”
virtualhost-node1.conf: |
server {
listen 80;
server_name ~^(?P<servicename1>.+)\-node1\..+\.example\.com$;
set $backend1 "http://$servicename1:8080";
client_max_body_size 1024M;
client_body_buffer_size 16k;
proxy_connect_timeout 9000;
proxy_send_timeout 9000;
proxy_read_timeout 9000;
send_timeout 9000;
client_header_timeout 9000;
client_body_timeout 9000;
fastcgi_read_timeout 9000;
fastcgi_buffers 8 512k;
fastcgi_buffer_size 512k;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
resolver 127.0.0.1:53 ipv6=off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass $backend1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 1024M;
client_body_buffer_size 16k;
proxy_connect_timeout 9000;
proxy_send_timeout 9000;
proxy_read_timeout 9000;
send_timeout 9000;
fastcgi_read_timeout 9000;
fastcgi_buffers 8 512k;
fastcgi_buffer_size 512k;
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。