Nginx处理HTTPS包含HTTP警告问题(只能支持Chrome43.0)

/ Linux服务器 / 3 条评论 / 1370浏览

##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

  1. 还要配置下nginx

    回复
  2. 要先申请ssl证书 再把证书放到服务器上

    回复
  3. 你好,我也用了Tale。 我想请问你的网站是怎么弄成https连接的?

    回复