美文网首页
Nginx 正向代理脚本

Nginx 正向代理脚本

作者: Svon_Book | 来源:发表于2023-02-27 10:15 被阅读0次
yum -y install pcre pcre-devel openssl-devel gcc make gcc-c++ install git
mkdir -p /server/tools
mkdir /app
cd /server/tools/
git clone https://github.com/chobits/ngx_http_proxy_connect_module.git
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -xf nginx-1.18.0.tar.gz
cd nginx-1.18
patch -p1 < /server/tools/ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_101504.patch
./configure --prefix=/app/nginx-1.18.0 --with-http_stub_status_module --with-http_ssl_module --add-module=/server/tools/ngx_http_proxy_connect_module
make && make install
ln -sv /app/nginx-1.18.0 /app/nginx
echo > /etc/profile.d/nginx.sh
sed -i 'i export PATH=$PATH:/app/nginx/sbin'  /etc/profile.d/nginx.sh
source /etc/profile.d/nginx.sh


worker_processes 4;
events{
        worker_connections 1024;
}
http{
#server {
#                listen 80;
#                resolver 223.5.5.5;
#                location / {
#                                proxy_pass http://$http_host$request_uri;
#                                proxy_set_header HOST $http_host;
#                                proxy_buffers 256 4k;
#                                proxy_max_temp_file_size 0k;
#                                proxy_connect_timeout 60s;
#                                proxy_send_timeout 60s;
#                                proxy_read_timeout 60s;
#                                proxy_next_upstream error timeout invalid_header http_502;
#
#                }
#
#}
server {
          listen 443;
                resolver 223.5.5.5;
                error_log /var/log/http_error.log info;
                proxy_connect;
                proxy_connect_allow 443 563;
                proxy_connect_connect_timeout 10s;
                proxy_connect_read_timeout 10s;
                proxy_connect_send_timeout 10s;
                location / {
                        proxy_pass http://$host;
                        proxy_set_header HOST $host;
                }
}
}

相关文章

  • nginx代理,负载均衡以及https配置

    Nginx正向代理和反向代理 大家对Nginx反向代理并不陌生,但是很少有人用过Nginx的正向代理。先来通过一组...

  • Nginx 配置(二)

    1. Nginx 负载均衡 1.1 概述 Nginx 作为代理服务器角色, 有正向代理和反向代理 两种. 正向代理...

  • Nginx常用功能以及相关配置

    Nginx 常用的功能: 1、Http正向代理、反向代理 正向代理和反向代理的区别:1、正向代理:类似我们想要访问...

  • Nginx 反向代理与负载均衡

    Nginx特点:反向代理 正向代理说反向代理之前,我们先看看正向代理,正向代理也是大家最常接触的到的代理模式,我们...

  • Nginx 反向代理与负载均衡

    Nginx特点:反向代理 正向代理说反向代理之前,我们先看看正向代理,正向代理也是大家最常接触的到的代理模式,我们...

  • Nginx正向代理配置

    Nginx配置正向代理支持HTTP和HTTPS转发Nginx本身不支持HTTPS正向代理,需要安装ngx_http...

  • 代理、转发

    代理、转发 正向代理,代理客户端,例如 vpn。 反向代理,代理服务端,例如 Nginx 分发流量。 Nginx可...

  • nginx

    nginx的概念 正向代理 反向代理 服务器的类型: Nginx的特点 Nginx的基本模块

  • nginx常用功能全揭秘

    转载:nginx常用功能全揭秘 正向代理正向代理的配置 反向代理正向代理的配置 透明代理区别和联系 负载均衡ngi...

  • Nginx详解

    nginx详解 一、什么是正向代理和反向代理? 正向代理image反向代理image URI、URL和URN: U...

网友评论

      本文标题:Nginx 正向代理脚本

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