https跨域到http问题解决
生活随笔
收集整理的這篇文章主要介紹了
https跨域到http问题解决
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
整體結構
用戶--https-->Nginx--http-->Tomcat
頁面中包含了iframe,iframe的src也是Https的,但是當frame里面的內容表單提交后tomcat服務器處理成功想要重定向卻無法正常重定向,Chrome報錯如下
Mixed Content: The page at 'https://...../#' was loaded over HTTPS, but requested an insecure form action 'http://.../**/**'. This request has been blocked; the content must be served over HTTPS.
proxy.confproxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; #獲取真實ip client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k;defalutserver { listen 80 default_server;server_name localhost;return 301 https://$server_name:6663$request_uri; }server { listen 6663;server_name localhost;ssl on; ssl_certificate /home/dream/Https/ssl/server/server.crt; ssl_certificate_key /home/dream/Https/ssl/server/server.pem; ssl_client_certificate /home/dream/Https/ssl/server/root.crt;ssl_session_timeout 5m; ssl_verify_client on; #開戶客戶端證書驗證ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on;location / { proxy_pass http://127.0.0.1:8080/; } }解決方式在nginx配置文件添加:
proxy_pass http://127.0.0.1:8080/; proxy_redirect ~^http://([^:]+)(:\d+)?(.*)$ https://$1$3;總結
以上是生活随笔為你收集整理的https跨域到http问题解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: activePerl的PPM如何使用ht
- 下一篇: Windows Server 2012正