端口转发后,它只显示URL的IP

我configuration了nginx端口转发(端口80到8889)

并指出我的域名服务器的IP地址。

之后它成功地将我redirect到服务器。 当我尝试通过域地址访问url

但redirect后,我只能看到IP而不是我的url(即mydomain.com)在地址栏(即xx.xx.xx.xx:8889),我需要做的,如果我想在地址栏中显示域?

这是我的nginxconfiguration文件。

server { listen 80; server_name mywebsite.com 172.10.19.14; server_name proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; send_timeout 300; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8888/; } client_max_body_size 10M; error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } 

  1. 检查您的应用服务器configuration。
  2. 在框中,检查你的主机文件,并确保你有正确的CNAME和ALIAS条目,包括你的networking服务器。
  3. 进行更改后清除caching。

在进行任何更改之后,您应该重新启动,以确保在服务启动时收到最新的更改。