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 反向代理設定Nginx
- Nginx、haproxy反向代理設定Nginx
- Nginx代理設定 Host 和 X-Forward-ForNginxForward
- pnpm 設定代理NPM
- 代理的設定
- docker 設定代理Docker
- [nginx]域名設定Nginx
- 騰訊雲伺服器Nginx反向代理的Photoprism(包括https設定)伺服器NginxHTTP
- Git中設定代理和取消代理Git
- npm 設定埠代理NPM
- Gradle 代理設定Gradle
- sdk更新代理設定
- anaconda 設定代理
- linux 設定代理Linux
- nginx正向代理、反向代理Nginx
- 【Nginx】nginx虛擬機器設定Nginx虛擬機
- nginx做限流設定Nginx
- nginx的rewrite設定Nginx
- Mac怎麼設定代理IP,蘋果系統設定http代理ip教程Mac蘋果HTTP
- Nginx反向代理Nginx
- nginx代理配置Nginx
- nginx 代理websocketNginxWeb
- nginx代理websocketNginxWeb
- nginx 代理phpNginxPHP
- nginx 反向代理Nginx
- MacOS設定終端代理Mac
- 為終端設定代理
- tomcat代理的設定Tomcat
- git 設定和取消代理Git
- C# WebBrowser設定代理C#Web
- ubuntu 給 apt 設定代理UbuntuAPT
- vite 設定網路代理Vite
- Nginx日誌格式設定Nginx
- Nginx設定404頁面Nginx
- Nginx快取設定教程Nginx快取
- Nginx 教程(3):SSL 設定Nginx
- Nginx之路--配置正向代理、反向代理Nginx
- Nginx正向代理和反向代理配置Nginx