Site updated: 2022-10-27 14:44:46
This commit is contained in:
19
atom.xml
19
atom.xml
@ -22,7 +22,8 @@
|
||||
<link rel="alternate" href="https://blog.jingxiyuan.cn/2022/10/27/%E6%9E%81%E7%A9%BA%E9%97%B4web%E7%AB%AFhttps%E7%9B%B4%E8%BF%9Enginx%E9%85%8D%E7%BD%AE/"/>
|
||||
<content type="html"><h4 id="介绍"><a class="anchor" href="#介绍">#</a> 介绍</h4>
|
||||
<ul>
|
||||
<li>ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。</li>
|
||||
<li>ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。<br />
|
||||
<img data-src="https://file.jingxiyuan.cn/images/2022/10/27/2022-10-27-14-39-25.jpg" alt="" /></li>
|
||||
</ul>
|
||||
<h4 id="配置"><a class="anchor" href="#配置">#</a> 配置</h4>
|
||||
<ol>
|
||||
@ -54,15 +55,15 @@ server &#123;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# 开启OCSP stapling
|
||||
|
||||
#开启OCSP stapling
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
|
||||
client_max_body_size 128M;
|
||||
|
||||
|
||||
add_header Strict-Transport-Security &quot;max-age=31536000; includeSubdomains; preload&quot;;
|
||||
|
||||
|
||||
proxy_send_timeout 180s; #设置发送超时时间
|
||||
proxy_read_timeout 180s; #设置读取超时时间
|
||||
|
||||
@ -71,7 +72,7 @@ server &#123;
|
||||
proxy_hide_header Server;
|
||||
proxy_hide_header X-AspNetMvc-Version;
|
||||
proxy_hide_header X-AspNet-Version;
|
||||
|
||||
|
||||
# http security headers
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header Pragma no-cache;
|
||||
@ -92,11 +93,11 @@ server &#123;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
|
||||
proxy_pass http://极空间内网ip:5055; #这里设置你自己要跳转的局域网应用;
|
||||
proxy_redirect http://域名:5055/home https://域名:10000/home; #极空间在登陆后会跳转到http协议的5055端口,所以要在此替换为https协议的10000端口
|
||||
&#125;
|
||||
|
||||
|
||||
error_page 500 502 503 504 /500.html;
|
||||
error_page 400 404 /500.html;
|
||||
location = /500.html &#123;
|
||||
|
Reference in New Issue
Block a user