【发布时间】:2023-01-27 12:46:29
【问题描述】:
我正在尝试使用在 Windows 10 机器上运行的 wsl-Ubuntu 中使用 proxy_pass 的开放式 resty lua 脚本来访问本地主机服务(http://localhost/foo/hostname)。
这是内容nginx 配置文件
worker_processes 2;
events {
worker_connections 1024;
}
http {
server {
listen 8082;
location /{
resolver 8.8.4.4;
set $target 'localhost/foo/hostname';
proxy_pass http://$target;
}
}
}
我有一个 '502错误的网关' 对 localhost:8082 进行卷曲时的响应 这是在中发现的错误错误日志文件
2023/01/27 09:31:17 [error] 331#331: *1 localhost could not be resolved (110: Operation timed out), client: 127.0.0.1, server: , request: "GET / HTTP/1.1", host: "localhost:8082"
我尝试了各种解决方案,包括修改解析器选项。
【问题讨论】:
标签: nginx lua wsl-2 proxypass openresty