简体   繁体   English

nginx 重定向到虚假域

[英]nginx redirect to a false domain

Hello I am trying to use a subdomain, but the redirection fails.您好我正在尝试使用子域,但重定向失败。

server {
listen 80;
server_name sub.domain.de;
   location / {
      proxy_pass http://ip;
   }
}

It redirects me to google, because i input google in proxy_pass before.它将我重定向到 google,因为我之前在 proxy_pass 中输入了 google。 same for port 443端口 443 相同

what can I do to stop the redirecting to the old test-path?我该怎么做才能停止重定向到旧的测试路径?

  • Maybe you have not restarted nginx after changing the config.更改配置后,您可能还没有重新启动 nginx。 When changing config, restart with systemctl restart nginx .更改配置时,使用systemctl restart nginx

  • Maybe google replied with a 301 permanent redirect.也许谷歌回复了 301 永久重定向。 Browsers essentially cache 301s forever.浏览器基本上永远缓存 301。 Clear your browser's cache, that should fix it.清除浏览器的缓存,应该可以解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM