502 Bad Gateway - NGINX no resolver defined to resolve

北慕城南 提交于 2019-12-07 20:21:14

问题


I have created a proxy pass for multi URLs.

    listen 80;
    listen [::]:80;

    server_name ~^(.*)redzilla\.11\.75\.65\.21\.xip\.io$;

            location / {
                    set $instname $1;
                    proxy_pass http://${instname}redzilla.localhost:3000;
            }

When I call to this service using chrome, It was triggered 502 error.

http://test.redzilla.11.75.65.21.xip.io/

I put below location tag by hard coding the URL.

            location /redzilla {
                    proxy_pass http://test.redzilla.localhost:3000;
            }

Then It is working for only above URL. I want to know how to create proxy pass for multiple URL within single location tag. ( please note : URL pattern is *.redzilla.localhost:3000 , * ( star ) represent any word)

来源:https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!