其实很简单:
1
2
3
|
if ($server_port != '80' ) {
rewrite ^/(.*)$ http: // $host/$1 permanent;
} |
举一反三。。。
1
2
3
|
if ($server_port != '443' ) {
rewrite ^/(.*)$ https: // $host/$1 permanent;
} |
1
2
3
|
if ($host != 'host' ) {
rewrite ^/(.*)$ http: //host/ $1 permanent;
} |
本文转自 ninnycalf 51CTO博客,原文链接:http://blog.51cto.com/314258/1897476