Nginx代理
2018-06-29 本文已影响0人
cybersword
https://blog.csdn.net/tobacco5648/article/details/51099426
http {
server {
server_name example.com;
location /mail/ {
proxy_pass http://example.com:protmail/;
}
location /com/ {
proxy_pass http://example.com:portcom/main/;
}
location / {
proxy_pass http://example.com:portdefault;
}
}
}
- 将 http://example.com/mail/ 下的请求转发到 http://example.com:portmail/
- 将 http://example.com/com/ 下的请求转发到 http://example.com:portcom/main/
- 将其它所有请求转发到 http://example.com:portdefault/