本机作为https服务器

 server {
listen ssl;
server_name localhost; ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
ssl on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; location / {
root html;
index index.html index.htm;
}
}

https转发到其他机器的http端口

   # HTTPS server
#
server {
listen ssl;
server_name localhost; ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
ssl on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; location / {
#root html;
#index index.html index.htm;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.0.105/;
}
}

80端口强制跳转https

     server {
listen 192.168.1.111:;
server_name test.com; rewrite ^(.*)$ https://$host$1 permanent;
}

最新文章

  1. Find and delete duplicate files
  2. html+css笔记
  3. CF2.C(二分贪心)
  4. django个人总结
  5. sys.dm_tran_locks,
  6. MyBatis学习总结(二)——使用MyBatis对表执行CRUD操作
  7. 拓扑排序--UVa10305
  8. Sql遍历数据库
  9. 一行JavaScript代码获取页面中的所有超链接地址
  10. [译]ava 设计模式之构造器
  11. Java 代码性能优化
  12. ubutun 安装php7.1x
  13. SequoiaDB版本在线升级介绍说明
  14. PHP执行linux命令mkdir权限问题
  15. 痞子衡嵌入式:飞思卡尔i.MX RT系列MCU特性介绍(4)- RT105x选型
  16. Two (DP)
  17. WPF Path总结(一)
  18. Spring MVC基础知识整理➣国际化和异常处理
  19. Eclipse 中 Debug 时鼠标悬停无法查看变量值
  20. uWSGI+APScheduler不能执行定时任务

热门文章

  1. Delphi中Json格式读写
  2. Unity 资源的优化管理 学习
  3. java_oop_类与对象
  4. oracle数据字典-权限-角色-参数
  5. CloudStack学习-2
  6. str的用法
  7. [转]Proxy代理详解
  8. tornado请求头/状态码/接口 笔记
  9. Quartz定时任务详解一
  10. CRC8校验