【发布时间】:2020-09-06 21:19:17
【问题描述】:
我正在尝试反向代理任何请求的域,我的代码仅适用于特定域,例如:
server {
listen 80;
server_name localhost;
location / {
rewrite_log on;
proxy_pass https://www.example.com;
}
}
这在 http://localhost:80/www.example.com 请求时不起作用。
location ~ ^/(.*)/ {
resolver 8.8.8.8;
proxy_pass http://$1;
}
也不是这个
location / {
resolver 8.8.8.8;
proxy_pass http://$http_host$uri$is_args$args;
}
【问题讨论】:
标签: nginx nginx-reverse-proxy nginx-location