我的网站“staging.my_website.com”的nginxconfiguration的一部分Nginx是在这种情况下的反向代理:
server { listen 80 default_server; listen [::]:80 default_server; server_name staging.my_website.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name localhost www.staging.my_website.com; return 301 https://staging.my_website.com$request_uri; } server { listen 443 ssl default_server; listen [::]:443 ssl default_server; server_name staging.my_website.com; location / { # ............... proxy_pass http://localhost:1234; proxy_redirect http://localhost:1234 https://staging.my_website.com;
它不工作:
staging.my_website.com show the default page of nginx htttps://staging.my_website.com -- unavailable
也:
$ curl -v http://localhost:1234 * Rebuilt URL to: http://localhost:1234/ * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 1234 (#0) > GET / HTTP/1.1 > Host: localhost:1234 > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 301 Moved Permanently < server: ...... < date: ............. < content-length: 0 < cache-control: max-age=0, private, must-revalidate < location: https://my_website.com/ # why not staging????? < * Connection #0 to host localhost left intact
请注意,在“my_website.com” – 一个单独的服务器 – 一切正常。
更新 :
我已经重新部署了我的networking应用程序。 但是,一切都保持不变。 除此之外:
# ............. < location: https://staging.my_website.com/
但是和以前一样:
staging.my_website.com -- shows the default page of nginx htttps://staging.my_website.com -- unavailable