目前我正在运营一个网站
centOS7上的Nginx / 1.6.3
除了一些重定向外,一切都运行顺畅.
这是我的.conf文件的样子:
server {
listen 443 ssl spdy default deferred;
server_name .example.com;
... more configs
}
server {
listen 80;
server_name .example.com;
return 301 https://example.com$request_uri;
}
我想要完成的是以下场景:
user visits in browser | this should happen
------------------------------------|-------------------------------------
https://example.com$request_uri | Just deliver content
https://*.example.com$request_uri | 301 https://example.com$request_uri
https://123.123.123.123$request_uri | 301 https://example.com$request_uri
http://example.com$request_uri | 301 https://example.com$request_uri
http://*.example.com$request_uri | 301 https://example.com$request_uri
http://123.123.123.123$request_uri | 301 https://example.com$request_uri