【55-nginx_conf_https, nginx配置https】时人不识凌云木,直待凌云始道高。这篇文章主要讲述55-nginx_conf_https, nginx配置https相关的知识,希望能为你提供帮助。
#usernobody;
worker_processes1;
#error_loglogs/error.log;
#error_loglogs/error.lognotice;
#error_loglogs/error.loginfo;
#pidlogs/nginx.pid;
events
worker_connections1024;
http
includemime.types;
default_typeapplication/octet-stream;
#log_formatmain$remote_addr - $remote_user [$time_local] "$request"
#$status $body_bytes_sent "$http_referer"
#"$http_user_agent" "$http_x_forwarded_for";
#access_loglogs/access.logmain;
sendfileon;
#tcp_nopushon;
#keepalive_timeout0;
keepalive_timeout65;
#gzipon;
# HTTPS server
#
server
listen443 ssl;
server_nameql.gaojilaochacang.com;
ssl_certificate/home/gpkey/gp.pem;
ssl_certificate_key/home/gpkey/gp.key;
ssl_session_cacheshared:SSL:1m;
ssl_session_timeout5m;
ssl_ciphersHIGH:!aNULL:!MD5;
ssl_prefer_server_cipherson;
location /
proxy_passhttp://127.0.0.1:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
# for websocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
server
listen 80;
server_name ql.gaojilaochacang.com;
#将请求转成https
rewrite ^(.*)$ https://$host$1 permanent;
推荐阅读
- 提高win7系统速度 加快深度技术Win7本地硬盘传文件速度
- LINUX随笔十一 yum安装rpm包后本地不清除
- Kubernetes——安全机制
- LINUX随笔十二 OpenBLAS blas_thread_init
- #yyds干货盘点#Ngrok(内网穿透工具)使用教程
- 压箱底的10款在线工具平台
- 网站排障分析常用的命令
- python 包之 mongodb 数据库操作教程
- 华为笔记本klvc-wfe9l 密码忘记了