Nginx 代理設定
192.168.169.123 8081埠 代理 http://192.168.169.191
192.168.169.123 8082埠 代理 http://192.168.169.192
配置檔案:
server{
listen 8081;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.191/;
}
}
server{
listen 8082;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.192/;
}
}
負載均衡配置
upstream js {
server 192.168.169.191:80 weight=1;
server 192.168.169.192:80 weight=1;
}
server{
listen 8090;
server_name js;
location / {
proxy_pass
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
192.168.169.123 8082埠 代理 http://192.168.169.192
配置檔案:
server{
listen 8081;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.191/;
}
}
server{
listen 8082;
server_name localhost;
location /{
# root html;
# index index.html index.html iisstart.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://192.168.169.192/;
}
}
負載均衡配置
upstream js {
server 192.168.169.191:80 weight=1;
server 192.168.169.192:80 weight=1;
}
server{
listen 8090;
server_name js;
location / {
proxy_pass
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28282660/viewspace-2147429/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Nginx代理設定 Host 和 X-Forward-ForNginxForward
- anaconda 設定代理
- pnpm 設定代理NPM
- docker 設定代理Docker
- linux 設定代理Linux
- 代理的設定
- 騰訊雲伺服器Nginx反向代理的Photoprism(包括https設定)伺服器NginxHTTP
- nginx做限流設定Nginx
- npm 設定埠代理NPM
- nginx正向代理、反向代理Nginx
- Nginx設定404頁面Nginx
- Nginx日誌格式設定Nginx
- Nginx快取設定教程Nginx快取
- vite 設定網路代理Vite
- ubuntu 給 apt 設定代理UbuntuAPT
- MacOS設定終端代理Mac
- Python怎麼設定代理Python
- nginx代理配置Nginx
- Nginx反向代理Nginx
- nginx 代理 minioNginx
- nginx 反向代理Nginx
- nginx代理websocketNginxWeb
- nginx 代理phpNginxPHP
- nginx 代理websocketNginxWeb
- Mac怎麼設定代理IP,蘋果系統設定http代理ip教程Mac蘋果HTTP
- nginx設定X-Frame-OptionsNginx
- 為Docker容器設定http代理DockerHTTP
- mumu模擬器設定代理
- Java怎麼設定代理使用?Java
- Python requests設定代理的方法Python
- JAVA設定http請求代理JavaHTTP
- Python代理IP的使用和代理池的設定Python
- Nginx正向代理和反向代理配置Nginx
- Nginx之路--配置正向代理、反向代理Nginx
- Nginx代理服務Nginx
- Nginx 代理快取Nginx快取
- Nginx 配置反向代理Nginx
- Nginx代理轉發Nginx
- Nginx 配置:反向代理Nginx