美文网首页
Nginx处理HTTPS包含HTTP警告问题(只能支持Chrom

Nginx处理HTTPS包含HTTP警告问题(只能支持Chrom

作者: zxk175 | 来源:发表于2017-05-02 11:53 被阅读197次

    1.下载Nginx的headers-more-nginx-module

    [root@localhost ~]# wget https://github.com/openresty/headers-more-nginx-module/archive/v0.32.tar.gz

    2.编译Nginx

    [root@localhost ~]# cd nginx-1.10.3
    [root@localhost nginx-1.10.3]#./configure
    --prefix=/zxk175/nginx/nginx
    --user=nginx
    --group=nginx
    --with-http_ssl_module
    --with-http_flv_module
    --with-http_gzip_static_module
    --with-http_stub_status_module
    --add-module=/zxk175/nginx/headers-more-nginx-module-0.32
    [root@localhost ~]# make clean
    [root@localhost ~]# make

    3.安装Nginx

    [root@localhost ~]# make install

    4.修改nginx配置

    location / {
        more_set_headers "Server: Nginx Web Server";
        more_set_headers "Content-Security-Policy: upgrade-insecure-requests";
        proxy_pass http://tale;
        include /zxk175/nginx/nginx/conf/conf/proxy.conf;
        root    /zxk175/tale/resources;
        index index.jsp index.htm index.html;
    }
    

    5.测试Nginx配置和启动

    [root@localhost sbin]# ./nginx -t
    [root@localhost sbin]# ./nginx

    相关文章

      网友评论

          本文标题:Nginx处理HTTPS包含HTTP警告问题(只能支持Chrom

          本文链接:https://www.haomeiwen.com/subject/vrectxtx.html