Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2022-11-25 04:47:23
Size: 307
Editor: localhost
Comment:
Revision 4 as of 2022-11-25 05:12:39
Size: 1011
Editor: localhost
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
systemctl enable nginx; systemctl start nginx

== 外网映射 ==
在出口设备做好端口映射,比如 外网IP:80 --> NGINX-IP:80端口 即可
Line 18: Line 22:
在NGINX服务器上增加proxy_pass配置.
{{{
cat > /etc/nginx/conf.d/drive.conf <<"EOF"
 server { # simple load balancing
     listen 80;
     server_name drive.XXX.com.cn;
     access_log /var/log/nginx/drive_access.log main;
 
     location / {
       proxy_pass http://10.77.77.77; ## 实际的云盘服务器地址
     }
   }
EOF
}}}
 * 测试配制文件是否OK
nginx -t

 * 如无问题, 重新加载NGINX配置即可
systemctl reload nginx

= References =
https://www.jianshu.com/p/b010c9302cd0

Describe désert/Linux/Nginx here.

NGINX 做为反向代理服务器的应用

工作原理简述

安装和配置

以CentOS7为例

安装NGINX

yum -y install epel-release && yum -y install nginx

启动NGINX

systemctl enable nginx; systemctl start nginx

外网映射

在出口设备做好端口映射,比如 外网IP:80 --> NGINX-IP:80端口 即可

增加proxy_pass网站配置

在NGINX服务器上增加proxy_pass配置.

cat > /etc/nginx/conf.d/drive.conf <<"EOF"
 server { # simple load balancing
     listen          80;
     server_name     drive.XXX.com.cn;
     access_log      /var/log/nginx/drive_access.log main;
 
     location / {
       proxy_pass      http://10.77.77.77; ## 实际的云盘服务器地址
     }
   }
EOF
  • 测试配制文件是否OK

nginx -t

  • 如无问题, 重新加载NGINX配置即可

systemctl reload nginx

References

https://www.jianshu.com/p/b010c9302cd0

désert/Linux/Nginx (last edited 2022-11-25 05:20:27 by merlyn)