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

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Page 1:nginx 服务器安装及配置文件详解 CentOS 6.2 x86_64 安装 nginx 1.1 ...
    xiaojianxu阅读 12,726评论 1 41
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,281评论 19 139
  • nginx在工作中已经有好几个环境在使用了,每次都是重新去网上扒博客,各种编译配置,今天自己也整理一份安装文档和n...
    AndyChin阅读 6,867评论 0 4
  • 编译自:installing-nginx-open-source 目录 选择 Stable 还是 Mainline...
    C86guli阅读 9,275评论 0 21
  • 雨后的山村一片寂静,偶尔只能听见几声滴水声。树叶飘进水洼中,砸得水面泛起层层涟漪,荡来荡去的,像一只小船。远处潮湿...
    菊隐楼主阅读 4,090评论 3 6

友情链接更多精彩内容