nginx 非80、443端口跳转到80、443
生活随笔
收集整理的這篇文章主要介紹了
nginx 非80、443端口跳转到80、443
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
其實很簡單:
| 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; } |
總結
以上是生活随笔為你收集整理的nginx 非80、443端口跳转到80、443的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nginx自定义500、404错误页面
- 下一篇: 整数数组按绝对值排序