Question

For a particular internal purpose I would like to send people back to a url on their own machine, how exactly would I do this? I can't really do

server {
    server_name www.yayaya.com;
    rewrite ^(.*) localhost:3000$1 permanent;
}

because that will point to the server's localhost, right?

Was it helpful?

Solution

either it does the lookup on the server and converts "localhost" to "127.0.0.1" or it hands "localhost" to the client, which will still convert it to "127.0.0.1"

So either way, the client should be redirected to 127.0.0.1, which should be correct.

I'm not an expert on nginx but I don't see why your example wouldn't work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top