Akiraka Akiraka
  • 首页
  • Linux
    • ELK
    • PHP
    • Shell
    • Nginx
    • Docker
      • Docker Compose
    • Centos
    • Ubuntu
    • Jenkins
  • Python
  • Mac OS
  • Windows
  • 大数据
    • Hadoop
    • CDH
    • Hive
    • Spark
    • ZooKeeper
  • 微服务
    • Kubernetes
    • Helm
  • Other
  • Quark
  • 首页
  • Linux
    • ELK
    • PHP
    • Shell
    • Nginx
    • Docker
      • Docker Compose
    • Centos
    • Ubuntu
    • Jenkins
  • Python
  • Mac OS
  • Windows
  • 大数据
    • Hadoop
    • CDH
    • Hive
    • Spark
    • ZooKeeper
  • 微服务
    • Kubernetes
    • Helm
  • Other
  • Quark
首页 › Linux › Nginx › Docker Nginx反向代理支持websocket

Docker Nginx反向代理支持websocket

Akiraka1年前
upstream rancher {
  server rancher:80;
  server rancher:443;
}
server {
  listen 80;
  listen 443 ssl http2;
  ssl_certificate /usr/local/nginx/conf/ssl/rancher.akiraka.com.pem;
  ssl_certificate_key /usr/local/nginx/conf/ssl/rancher.akiraka.com.key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers on;
  ssl_session_timeout 10m;
  ssl_session_cache builtin:1000 shared:SSL:10m;
  ssl_buffer_size 1400;
  add_header Strict-Transport-Security max-age=15768000;
  ssl_stapling on;
  ssl_stapling_verify on;
  server_name rancher.akiraka.net;
  if ($ssl_protocol = "") { return 301 https://$host$request_uri; }

  location / {
    proxy_pass https://rancher;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    # 启用支持websocket连接
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
}
#nginx
0
分享
Akiraka 站长
文章 121评论 10
相关文章
  • Kubernetes(k8s)helm 部署 Nginx Ingress
  • 使用 Docker 部署 LNMP 环境
  • Docker 使用官方镜像构建 nginx 容器
  • DockerFile 源码编译 Nginx 容器
  • 针对切割Nginx动态日志自动拉黑脚本
Akiraka
站长
本人擅长 Ai、Au、Fl、Ae、Pr、Ps 等软件的安装与卸载,精通 CSS、JavaScript、PHP、Python、Shell、Go 等单词的拼写,熟悉 Windows、Linux、Mac、Android、IOS 等系统的开关机!
121文章
10评论
47获赞
想找什么搜一下
文章聚合
使用 Docker 部署 LNMP 环境
1年前
shell 判断文件夹或文件是否存在
1年前
Linux 免秘钥登录
1年前
大数据环境 Pyenv 搭建
1年前
Kubernetes(k8s)Helm 部署 Redis 集群
10月前
微信小程序
微信小程序
标签云
brew cdh centos cmd docker docker compose elasticsearch elk filebase filebeat gitlab grafana hadoop helm hive hue jdk jenkins k8s kibana kubernetes liniux linux logstash mac mikrotik mydumper mysql nfs nginx openssl oss php pip pyspark python RabbitMQ redis rocketmq shell Spark ubuntu windows ZooKeeper 容器编排
Copyright © 2019-2021 Akiraka. Designed by nicetheme. 沪18036911号