#websoceket 使用map
map $http_upgrade $connection_upgrade {default upgrade;''      close;
}upstream abc.com
{server 47.***.***.1:8012;
}
server {listen 80;server_name www.abc.com  abc.com;rewrite ^(.*) https://$host$1 permanent;
}
server{listen 443 ssl;server_name www.abc.com  abc.com;index index.html index.htm index.php;ssl on;  ssl_certificate         /etc/letsencrypt/live/www.abc.com/fullchain.pem;ssl_certificate_key     /etc/letsencrypt/live/www.abc.com/privkey.pem; ssl_session_timeout 5m;ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;ssl_prefer_server_ciphers   on;location /{proxy_pass http://abc.com;             proxy_set_header   X-Real-IP            $remote_addr;proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;proxy_set_header   Host                   $http_host;proxy_set_header   X-NginX-Proxy    true;proxy_set_header   Connection "";proxy_http_version 1.1;proxy_connect_timeout 1; proxy_send_timeout 30; proxy_read_timeout 60;}error_log   logs/abc_error.log;}

转载于:https://www.cnblogs.com/yysbolg/p/10330713.html

nginx 转将http跳转到https相关推荐

  1. Nginx:http自动跳转到https

    https是更安全的http,通过http自动跳转https,可以更便于用户使用web. 有几下几个方法可以完成跳转: 1.打开http和https的server,让http跳转到https serv ...

  2. nginx配置http自动跳转https方案

    功能:ssl配置后的301跳转,http跳转到https 描述:利用rewrite方式301永久跳转到https 注意:需先配置好ssl证书,这篇文章说的也是在ssl证书部署后进行301重定向的方式. ...

  3. nginx设置http强制跳转https

    本文来说下nginx设置http强制跳转https 文章目录 概述 概述

  4. Nginx配置http301强制跳转https

    Nginx配置http301强制跳转https http强制跳转到https 在nginx配置文件内添加: if ($scheme = http) {return 301 https://$serve ...

  5. 301跳转 https_使用Nginx实现301跳转至https的根域名示例代码

    基于 SEO 和安全性的考量,需要进行 301 跳转,以下使用 Nginx 作通用处理 实现结果 需要将以下地址都统一跳转到 https 的根域名 https://chanvinxiao.com ht ...

  6. nginx 强制使用https访问(http跳转到https)

    nginx强制使用https访问(http跳转到https) 基于nginx搭建了一个https访问的虚拟主机,监听的域名是test.com,但是很多用户不清楚https和http的区别,会很容易敲成 ...

  7. Nginx rewrite规则实现http跳转到https及301永久重定向

    Nginx rewrite规则实现http跳转到https及301永久重定向 环境准备: [root@ubuntu1804 ~]#curl https://linux2022.com -Ik HTTP ...

  8. nginx 利用497错误来从http跳转到https

    参考https://www.cnblogs.com/nuccch/p/7681592.html 例子 server {listen 80;listen 443 ssl;server_name doma ...

  9. 阿里云SLB上http强制跳转到https问题处理

    背景: 最近一客户有一个需求,需要将外网所有http访问请求强制跳转到https,公网出口使用阿里云SLB,证书放在SLB上,SLB后端实例为ECS(webserver)web服务使用nginx, 网 ...

最新文章

  1. 体验Windows 7的Superbar
  2. 干货回顾丨深度学习性能提升的诀窍
  3. 2015.7.16(小高开忍住没有减仓,大盘涨3.5%,百股涨停——买进中重、中航,指导WXL错误)...
  4. curl 升级 php,将命令行cURL转换为PHP cURL
  5. 华南理工大计算机博士毕业条件,华南理工大学博士毕业要求-2018年7月版.doc
  6. python智能工厂_智能工厂关键技术应用 第八讲 智能工厂的Python编程应用
  7. c语言中精度站的字节,C语言学习--一些细节问题
  8. 如何一本正经地写出别人无法维护的代码?
  9. 各种编程技术中的$符的使用
  10. brave浏览器_据说只有这款浏览器,真正做到了保护隐私
  11. html打印预览空白,打印预览空白,网页打印空白原因及解决办法汇总
  12. matlab 结构体struct函数使用方法
  13. PPT | 5G时代的视频云服务关键技术与实践
  14. java gui 记_java GUI简单记事本
  15. 摘自_sina_海派与京派画作_吴昌硕_徐渭_齐白石
  16. A Personality traits and job candidate screening via analyzing facial videos 阅读笔记
  17. 一个手机壳把华为4G机型升级到5G,首先适配P50Pro,售价799元计划下月开卖
  18. 配置tensorflow-gpu,大过年的头秃啊
  19. Django中summernote富文本编辑器完整前后端
  20. 新手常见的5个Python错误

热门文章

  1. 有没有python与机械结合的工作-Python3从零开始搭建一个语音对话机器人的实现...
  2. python自学视频教程-私藏已久的7个Python视频教程
  3. 零基础自学python的app-零基础入门免费学Python 课程和APP推荐
  4. python 命令-新手向——用python编写命令行应用的简洁方式
  5. python怎么画简单图片-python中简单易学的绘图:用turtle画太极图
  6. python零基础能学吗 知乎-如何零基础入门 Python?
  7. python3.7入门教程-python 3.7极速入门教程5循环
  8. python3入门-终于懂得python3快速入门教程
  9. python培训班一般多少钱-广州Python培训机构一般多少钱
  10. python解释器运行代码-python解释器怎么运行