【Nginx】- 代理https

1、nginx文件配置

location ^~ /xxx/ {
    proxy_pass https://xxx.com/;
}

2、cd /usr/local/nginx/nginx-1.13.7 然后执行如下命令

[root@dex nginx-1.13.7]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module

3、需要先停掉nginx 然后在执行make 进行重新编译

pkill -9 nginx // 强制停止nginx
[root@dex nginx-1.13.7]# make

4、把刚才编译的nginx 拷贝覆盖原来的nginx

[root@dex nginx-1.13.7]# cp ./objs/nginx /usr/local/nginx/sbin/

5、检查并启动nginx

[root@dex nginx-1.13.7]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@dex nginx-1.13.7]# /usr/local/nginx/sbin/nginx

 

posted @ 2021-05-26 09:28  迷你胡丶  阅读(299)  评论(0编辑  收藏  举报