https跨域到http问题解决
2017-11-16 17:57
288 查看
整体结构
用户--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.
解决方式在nginx配置文件添加:
用户--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.conf proxy_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; defalut server { 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;[/code]
相关文章推荐
- Nginx 学习笔记(八)http和https跨域问题解决
- XMLHttpRequest cannot load 跨域问题解决
- PHP解决网站从http转https后引用的外部资源警告的问题
- 【Google Chrome】 Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource问题解决
- 解决Http或Https中下载中文文件乱码和无法下载问题
- XMLHttpRequest cannot load 跨域问题解决
- 关于http和https淘宝支付宝跨域解决方法研究
- golang http服务器跨域问题解决
- Nginx出现The plain HTTP request was sent to HTTPS port问题解决方法
- Discuz!教程之启用HTTPS后解决各处遗留http://网址问题
- 解决http转https在chrome里blocked的问题
- 解决android 5.0 webview不能加载http与https混合内容的问题
- PHP简单实现HTTP和HTTPS跨域共享session解决办法
- 解决ajax XMLHttpRequest 跨域上传文件失败问题
- 如何解决 XMLHttpRequest 跨域请求的问题
- 解决 nginx https反向代理http协议 302重定向localtion到http问题
- XMLHttpRequest cannot load 跨域问题解决
- HTTP请求跨域问题,解决模棱两可。
- JAVA调用https, JS跨域请求,客户端解决JS跨域问题, SOP
- 解决iOS9苹果将原http协议改成了https协议问题