我有我的nginx位置文件中的以下内容:
location = / { rewrite / /landing redirect; } location /landing { root /opt/deploy; rewrite ^/landing/resources/(.*) /landing/resources.html#/$1 last; rewrite ^/landing/blog/(.*) /landing/blog.html#/$1 last; try_files $uri $uri/ /landing/index.html; }
注意两个重写。
这些在我的testing服务器上工作得很好,但是在我的生产服务器上没有做任何事情。
NGINXconfiguration文件:
testing: https : //pastebin.com/yhahkWJP
制作: https : //pastebin.com/EWHGPFsy
输出的curl -v应该redirect的url
pastebin.com/uceE68Vx(对不起,这不是一个链接,没有足够的声誉超过2个链接)
其他事情是不同的:
testing有展厅子域名:showroom.companyName.com
Prod有www子域名:www.companyName.com
生产服务器有以下强制HTTPStesting服务器没有得到。
server { # Redirect all http to https traffic for everything. listen 80; return 302 https://$host$request_uri; }
有任何想法吗?