Solo  当前访客:1 开始使用

【Exception】Nginx报错no resolver defined to resolve解决


错误

[error] 51741#51741: *19794 no resolver defined to resolve localhost, client: xx.72.36.xx, server: tools.uproject.cn, request: "GET / HTTP/1.1", host: "tools.xx.cn"

解决方法

将server中localtion 配置修改为

location / {
        proxy_pass http://localhost:8022$request_uri;
        proxy_set_header  Host $http_host;
        proxy_set_header  X-Real-IP $remote_addr;
        client_max_body_size  10m;
    }
改为:
upstream tools_backend {
    server localhost:8022; 
}
location / {
        proxy_pass http://tools_backend$request_uri;
        proxy_set_header  Host $http_host;
        proxy_set_header  X-Real-IP $remote_addr;
        client_max_body_size  10m;
    }


标题:【Exception】Nginx报错no resolver defined to resolve解决
作者:hugh524
地址:https://blog.uproject.cn/articles/2023/01/01/1672555015857.html

0 0