nginx正向代理非默认端口
http_host变量自带端口,无需像有些解决方案那样采用lua来获取端口:
server {
resolver 114.114.114.114 8.8.8.8;
listen 10080;
location /
{
proxy_pass $scheme://$http_host$request_uri;
}
}
server {
resolver 114.114.114.114 8.8.8.8;
listen 10080;
location /
{
proxy_pass $scheme://$http_host$request_uri;
}
}