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
网友评论