出于特定的内部目的,我想将人们送回自己机器上的网址,我究竟会怎么做?我不能真的做到

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

因为那将指向服务器的localhost,对吗?

有帮助吗?

解决方案

要么在服务器上进行查找,要么转换“localhost”。至“127.0.0.1” 或它的手“localhost”到客户端,仍将其转换为“127.0.0.1”

无论哪种方式,客户端都应重定向到127.0.0.1,应该是 正确的。

我不是nginx的专家,但我不明白为什么你的例子不起作用。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top