nginx访问http80端口跳转https443端口
2017-02-13 18:01
471 查看
在配置文件中加入下面代码
server {
...
if ($server_port = 80){
return 301 https://$server_name$request_uri;}
if ($scheme = http){
return 301 https://$server_name$request_uri;} error_page 497 https://$server_name$request_uri; ....
}
server {
...
if ($server_port = 80){
return 301 https://$server_name$request_uri;}
if ($scheme = http){
return 301 https://$server_name$request_uri;} error_page 497 https://$server_name$request_uri; ....
}
相关文章推荐
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx实现某个页面http访问,其余全部跳转到https
- nginx强制使用https访问(http跳转到https)
- nginx网站开启https访问,http自动跳转到https
- nginx强制使用https访问(http跳转到https)
- Nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https) mark
- nginx配置http访问自动跳转到https
- 【环境配置】申请StartSSL免费CA证书,配置Nginx使用https访问,强制http跳转到https
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- 使用nginx实现http访问自动跳转到https端口
- nginx强制使用https访问(http跳转到https)
- Nginx-配置https虚拟服务(访问http时自动跳转https)
- 详解NGINX访问https跳转到http的解决方法
- nginx强制使用https访问的方法(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx 强制使用https访问(http跳转到https)