网站建设

nginx反向代理配置文件

daimafengzi · 9月26日 · 2023年 · 本文共1013个字 · 预计阅读4分钟6522次已读
include conf.d/*.conf;
upstream cms_server {
       server localhost:8080;
}
server
{
   listen 80;
   server_name www.aa.com;
   location / {
       proxy_redirect off;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://cms_server;
   }
}
server
{
   listen 80;
   server_name www.bb.com;
   location / {
       proxy_redirect off;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://cms_server;
   }
}
server
{
   listen 80;
   server_name www.cc.com;
   location / {
       proxy_redirect off;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://cms_server;
   }
}
server
{
   listen 80;
   server_name www.dd.com;
   location / {
       proxy_redirect off;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://cms_server;
   }
}
0 条回应