wikipedia 上说 upgrade 可以 Use with TSL,有大佬弄过么?
https://en.wikipedia.org/wiki/HTTP/1.1_Upgrade_header#Use_with_TLS
1
ivyliner 2018-05-09 18:56:53 +08:00
一般 upgrade 用在 websocket 和 HTTP/2 比较多.
http 要转换为 HTTPS, 直接在 nginx 301 跳转就可以了. |
2
myyou 2018-05-09 19:12:59 +08:00
websocket 不支持 http2
这是我的配置可以参考一下 ``` server { listen 443 ssl http2; server_name your.example.com; # 域名 charset utf-8; # 以下 ssl 目录根据实际情况进行调整 ssl_certificate /work/ssl/chained.pem; ssl_certificate_key /work/ssl/domain.key; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; add_header X-UA-Compatible "IE=edge,chrome=1"; # IE 用最新内核渲染页面 client_max_body_size 50M; location / { proxy_pass http://127.0.0.1:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; 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_redirect default; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; } } ``` |
3
gamexg 2018-05-09 20:06:41 +08:00 via Android
没浏览器支持这个吧。
|
4
Judoon 2018-05-09 20:15:40 +08:00
没试过,为什么不用 HSTS
|
5
msg7086 2018-05-10 06:35:43 +08:00
好像没见过有浏览器支持这个。为什么要在 80 端口上跑 HTTPS ?
|
6
KuroNekoFan 2018-05-10 09:39:12 +08:00 via iPhone
hsts 了解一下
|