我正在尝试将https重定向到http,将www重定向到非www。 但遗憾的是它没有用。
我需要它做的例子:
到目前为止,我所做的是:
# Redirect https to http:
#
server {
listen 443;
server_name www.example.com expample.com;
return 301 http://example.com$request_uri;
}
# Redirect www to non-www.
#
server {
#listen 80 is default
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
# The actual server configuration goes here:
#
server {
listen 80;
server_name example.com;
#rest of the block configuration
向前谢谢!