https网站如何访问http接口

一般而言,https网站上所有的请求资源都应该是https的,但是某些情况下也需要https能够访问到http,因此就用到nginx的反向代理

    server {
        listen       443 ssl;
        server_name  www.abc.com;
		
	ssl_certificate      xxx.pem;
        ssl_certificate_key  xxx.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            proxy_pass http://域名或ip/xxx/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header REMOTE-HOST $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
posted @ 2020-08-17 09:47  镇魂帆-张  阅读(23603)  评论(0编辑  收藏  举报