# 升级后SSL混合

**URL:** https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193
**Category:** Self-hosting
**Created:** [2022年十二月30日 12:17 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193 "2022-12-30T12:17:50Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 12:17 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/1 "2022-12-30T12:17:50Z")

</div>

我有一个（曾经是！）默认的、正常工作的反向代理安装。  
一切都按设计由 HTTPS 提供服务。

我跳过了几个版本，遇到了“死亡升级”，屏幕一直空白，正如这里报告的：[Upgrade discourse doesn't work - #6 by Andrew\_Bond](https://meta.discourse.org/t/upgrade-discourse-doesnt-work/250188/6)

我已通过 `./launcher rebuild app` 手动更新了我的 discourse，并且正在使用版本 2.9.0.beta14（[0da79561c3](https://github.com/discourse/discourse/commits/0da79561c32e41e7a51ba10622ff6d29cdd51dc4)）。

我注意到，如果尝试保存草稿，或执行大多数其他操作（如发帖、登录），我就会收到 403 禁止错误（通过 Chrome 检查器）。

不过，我的 Logo 在网站的左上角可以正常显示。

如果我通过命令行手动禁用强制 HTTPS 功能，Logo 就会加载失败，因为我处于混合模式，HTTP 元素被阻止。网站的所有其他元素继续正常工作。

我没有对反向 Nginx 进行任何更改。我尝试再次重建应用程序，但没有成功。

我建议，在我从其升级的构建版本中，Discourse 的工作方式发生了一些变化。这是我能找到的最后一个可以正常使用强制 HTTPS 选项的版本 ID：e9f53dbe0028ca7a5d8926711a1944765d34347

现在捕获的错误：

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/c/9/ac9ed6b29ed61cf71c88faf967af8e095a5e39a1.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 12:36 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/3 "2022-12-30T12:36:56Z")

</div>

您好 Andrew - 感谢您的报告。此问题特别影响反向代理配置，其中在请求到达应用程序容器之前会添加多个 `X-Forwarded-Proto` 标头。

我刚刚将一个修复程序合并到了 `main` 中 - 它应该会在大约 20 分钟后进入 tests-passed。

> <https://github.com/discourse/discourse/commit/584a6e35528800dffa23c2fb5525000dde8fa931>
>
> NGINX v1.23 concatenates duplicate headers into a single comma-separated string.… We were doing an equality check on \`x-forwarded-proto\`. If the request includes multiple \`x-forwarded-proto\` headers then this check would fail under NGINX v1.23, and our config assumed an \`http\` connection.
> 
> This commit updates the config to check for \`https\` at the end of the header, thereby restoring the old behavior when multiple \`x-forwarded-proto\` request headers are sent.

一旦它出现在 [tests-passed](https://github.com/discourse/discourse/commits/tests-passed) 中，您就需要进行完全重建（基于 UI 的升级期间不会应用 nginx 配置更改）。

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 12:43 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/4 "2022-12-30T12:43:12Z")

</div>

非常感谢您快速的回复和及时的修复！

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 14:37 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/5 "2022-12-30T14:37:07Z")

</div>

所以，更新一下。

我已使用 `./launcher rebuild app` 重新构建了应用程序。

那里没有问题。

强制 HTTPS 时错误已消失，但出现以下例外：

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/f/7/2f7d9ee4497095281b7d9e3ed2330d8c50aafbae.png)

我不再收到 403 拒绝访问的错误，但例如在尝试登录时，会弹出登录框，似乎接受了数据，然后再次显示未登录用户：

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/b/c/ebc7985a589314497c5c7115d0c70dd98c3dbd3f.png)

重新加载页面时会出现与上述相同的错误。

我已再次禁用强制 HTTPS，网站可以正常工作——但为了清楚起见，徽标仍未提供。

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 15:26 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/6 "2022-12-30T15:26:46Z")

</div>

> [@Andrew\_Bond](#):
>
> 强制使用 HTTPS 后，错误已消失，但出现以下例外：
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/2/f/7/2f7d9ee4497095281b7d9e3ed2330d8c50aafbae.png)

该错误无关紧要——它是由 Cloudflare 注入分析脚本引起的（并且 Discourse 的默认内容安全策略会阻止注入）。

> [@Andrew\_Bond](#):
>
> 我有一个（曾经！）默认工作的反向代理安装。

您能否分享更多关于您在用户和 Discourse 之间使用的代理的信息？我猜 Cloudflare 是第一层？在 Cloudflare 和 Discourse 应用容器之间还有什么？

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 15:27 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/7 "2022-12-30T15:27:43Z")

</div>

当然！\n\n你说得对。Cloudflare 是第一个命中，然后我们有 centminmod 提供的 nginx 反向代理到 docker。

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 15:29 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/8 "2022-12-30T15:29:24Z")

</div>

> [@Andrew\_Bond](#):
>
> nginx reverse proxy offered by centminmod onto the docker.

您能分享一下您的配置吗？特别是，它是否添加了额外的 `X-Forwarded-Proto` 标头？

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 15:33 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/9 "2022-12-30T15:33:43Z")

</div>

好的！

```plaintext
# Centmin Mod 入门指南
# 必须阅读 https://centminmod.com/getstarted.html
# 用于 HTTP/2 SSL 设置
# 阅读 https://centminmod.com/nginx_configure_https_ssl_spdy.html

# 从 www 重定向到非 www 强制 SSL
# 取消注释、保存文件并重启 Nginx 以启用
# 如果不确定，请在使用 return 301 之前使用 return 302
 server {
       listen 80;
       server_name exiges.com www.exiges.com;
       return 302 https://$server_name$request_uri;
 }

server {
  listen 443 ssl http2;
  server_name exiges.com www.exiges.com;

  ssl_dhparam /usr/local/nginx/conf/ssl/exiges.com/dhparam.pem;
  ssl_certificate /usr/local/nginx/conf/ssl/exiges.com/exiges.com.crt;
  ssl_certificate_key /usr/local/nginx/conf/ssl/exiges.com/exiges.com.key;
  include /usr/local/nginx/conf/ssl_include.conf;

  # Cloudflare 认证源拉取证书 community.centminmod.com/threads/13847/
  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/exiges.com/origin.crt;
  #ssl_verify_client on;

  # Mozilla 推荐
  ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256: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:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
  ssl_prefer_server_ciphers on;
  #add_header Alternate-Protocol 443:npn-spdy/3;

  # 在启用 HSTS 之前，请阅读 centminmod.com/nginx_domain_dns_setup.html#hsts
  #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
  #add_header X-Frame-Options SAMEORIGIN;
  add_header X-Xss-Protection "1; mode=block" always;
  add_header X-Content-Type-Options "nosniff" always;
  #add_header Referrer-Policy "strict-origin-when-cross-origin";
  #add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
  #spdy_headers_comp 5;
  ssl_buffer_size 1369;
  ssl_session_tickets on;

  # 启用 OCSP 装订
  #resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
  #resolver_timeout 10s;
  #ssl_stapling on;
  #ssl_stapling_verify on;
  #ssl_trusted_certificate /usr/local/nginx/conf/ssl/exiges.com/exiges.com-trusted.crt;

# ngx_pagespeed 和 ngx_pagespeed handler
#include /usr/local/nginx/conf/pagespeed.conf;
#include /usr/local/nginx/conf/pagespeedhandler.conf;
#include /usr/local/nginx/conf/pagespeedstatslog.conf;

  # limit_conn limit_per_ip 16;
  # ssi on;

  access_log /home/nginx/domains/exiges.com/log/access.log combined buffer=256k flush=5m;
  error_log /home/nginx/domains/exiges.com/log/error.log;

  include /usr/local/nginx/conf/autoprotect/exiges.com/autoprotect-exiges.com.conf;
  root /home/nginx/domains/exiges.com/public;
  # 如果使用 Cloudflare 作为服务器和/或虚拟主机站点，请取消注释 cloudflare.conf include
  #include /usr/local/nginx/conf/cloudflare.conf;
  include /usr/local/nginx/conf/503include-main.conf;

location / {
       proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
       proxy_set_header X-Forwarded-Proto https;
       proxy_http_version 1.1;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Real-IP $remote_addr;
   }

  include /usr/local/nginx/conf/php.conf;

  #include /usr/local/nginx/conf/pre-staticfiles-local-exiges.com.conf;
  #include /usr/local/nginx/conf/pre-staticfiles-global.conf;
  #include /usr/local/nginx/conf/staticfiles.conf;
  #include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
  #include /usr/local/nginx/conf/vts_server.conf;
}

```

我看到了 x-proto 标头的引用……

```
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 16:01 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/10 "2022-12-30T16:01:42Z")

</div>

Cloudflare 如何连接到您的源站？它是否正在使用 SSL/TLS？理想情况下，您应该在此处使用“Full”或“Full (Strict)”设置。

 ![Screenshot 2022-12-30 at 16.00.36](https://global.discourse-cdn.com/meta/original/4X/a/6/b/a6b55d92afc389a1ab47e876dbdf30e1a2bee609.jpeg)

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 17:19 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/11 "2022-12-30T17:19:33Z")

</div>

灵活。我一直很懒，没有使用服务器证书。

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 17:28 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/12 "2022-12-30T17:28:06Z")

</div>

我建议您使用 Cloudflare 的安全 SSL 选项之一。“灵活”意味着 Cloudflare 和您的服务器之间的流量未加密。

再次查看配置：

> [@Andrew\_Bond](#):
>
> ```plaintext
> proxy_set_header X-Forwarded-Proto https;
> proxy_http_version 1.1;
> proxy_set_header X-Forwarded-Proto $scheme;
> 
> ```

看起来您将标头设置为 `https`，然后在下面两行将其再次设置为 `$scheme`（根据您的 Cloudflare 配置，这将是 `http`）。如果删除第二个，Discourse 将被告知连接是安全的（即使它不是）。

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 19:31 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/13 "2022-12-30T19:31:35Z")

</div>

真有趣。

不过我发现奇怪的是它之前是能用的。

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022年十二月30日 19:50 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/14 "2022-12-30T19:50:13Z")

</div>

我怀疑（但尚未100%确认）Discourse容器NGINX之前查看的是“第一个”`X-Forwarded-Proto`头。现在，它查看的是“最后一个”`X-Forwarded-Proto`头，这可以说更安全，因为它来自“最近”的代理，该代理拥有关于传入请求的最多信息。

因此，在更新之前，它查看的是Cloudflare（https）引入的`X-Forwarded-Proto`头。现在，它查看的是您的“centminmod”反向代理配置（http）引入的`X-Forwarded-Proto`头。

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [2022年十二月30日 22:08 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/15 "2022-12-30T22:08:39Z")

</div>

> [@Andrew\_Bond](#):
>
> ```plaintext
> proxy_set_header X-Forwarded-Proto https;
> proxy_http_version 1.1;
> proxy_set_header X-Forwarded-Proto $scheme;
> 
> ```

我已从配置中删除 proxy\_set\_header X-Forwarded-Proto $scheme;，现在配置可以正常工作。

对于正在阅读并配置 centminmod 的各位，nginx 有两个配置文件。

一个用于 http，一个用于 https。

我已从 http 配置中删除了第二个 proxy\_set\_header X-Forwarded-Proto $scheme;，现在一切都按预期工作。

这是我的 exiges.com.conf

```plaintext
# Centmin Mod 入门指南
# 必须阅读 https://centminmod.com/getstarted.html

# 从非 www 重定向到 www
# 取消注释，保存文件并重启 Nginx 以启用
# 如果不确定，请在使用 return 301 之前使用 return 302
#server {
# listen 80;
# server_name exiges.com;
# return 301 $scheme://www.exiges.com$request_uri;
# }

server {
  server_name exiges.com www.exiges.com;
#return 301 https://exiges.com.com$request_uri;
#return 301 $scheme://www.exiges.com$request_uri;

# ngx_pagespeed 和 ngx_pagespeed 处理程序
#include /usr/local/nginx/conf/pagespeed.conf;
#include /usr/local/nginx/conf/pagespeedhandler.conf;
#include /usr/local/nginx/conf/pagespeedstatslog.conf;

  #add_header X-Frame-Options SAMEORIGIN;
  add_header X-Xss-Protection "1; mode=block" always;
  add_header X-Content-Type-Options "nosniff" always;
  #add_header Referrer-Policy "strict-origin-when-cross-origin";
  #add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";

  # limit_conn limit_per_ip 16;
  # ssi on;

  access_log /home/nginx/domains/exiges.com/log/access.log combined buffer=256k flush=5m;
  error_log /home/nginx/domains/exiges.com/log/error.log;

  include /usr/local/nginx/conf/autoprotect/exiges.com/autoprotect-exiges.com.conf;
  root /home/nginx/domains/exiges.com/public;
  # 如果使用 cloudflare 进行服务器和/或虚拟主机站点，请取消注释 cloudflare.conf include
  #include /usr/local/nginx/conf/cloudflare.conf;
  include /usr/local/nginx/conf/503include-main.conf;

  # 防止访问 ./目录和文件
  #location ~ (?:^|/)\. {
  # deny all;
  # }

  location / {
 proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
            proxy_set_header X-Forwarded-Proto https;
                #proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                #proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
  #include /usr/local/nginx/conf/503include-only.conf;

# 阻止常见的漏洞、SQL 注入等
#include /usr/local/nginx/conf/block.conf;

  # 在找不到索引文件时启用目录列表
  #autoindex on;

  # 显示本地时间的列表文件时间
  #autoindex_localtime on;

  # Wordpress 固定链接示例
  #try_files $uri $uri/ /index.php?q=$uri&$args;

  }

  include /usr/local/nginx/conf/php.conf;

  #include /usr/local/nginx/conf/pre-staticfiles-local-exiges.com.conf;
  #include /usr/local/nginx/conf/pre-staticfiles-global.conf;
  #include /usr/local/nginx/conf/staticfiles.conf;
  #include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
  #include /usr/local/nginx/conf/vts_server.conf;
}

```

这是我的 exiges.com.conf.ssl

```plaintext
# Centmin Mod 入门指南
# 必须阅读 https://centminmod.com/getstarted.html
# 对于 HTTP/2 SSL 设置
# 阅读 https://centminmod.com/nginx_configure_https_ssl_spdy.html

# 从 www 重定向到非 www 强制 SSL
# 取消注释，保存文件并重启 Nginx 以启用
# 如果不确定，请在使用 return 301 之前使用 return 302
# server {
# listen 80;
# server_name exiges.com www.exiges.com;
# return 302 https://$server_name$request_uri;
# }

server {
  listen 443 ssl http2;
  server_name exiges.com www.exiges.com;

  ssl_dhparam /usr/local/nginx/conf/ssl/exiges.com/dhparam.pem;
  ssl_certificate /usr/local/nginx/conf/ssl/exiges.com/exiges.com.crt;
  ssl_certificate_key /usr/local/nginx/conf/ssl/exiges.com/exiges.com.key;
  include /usr/local/nginx/conf/ssl_include.conf;

  # cloudflare 认证源拉取 cert community.centminmod.com/threads/13847/
  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/exiges.com/origin.crt;
  #ssl_verify_client on;

  # mozilla 推荐
  ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256: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:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
  ssl_prefer_server_ciphers on;
  #add_header Alternate-Protocol 443:npn-spdy/3;

  # 在启用 HSTS 之前，请阅读 centminmod.com/nginx_domain_dns_setup.html#hsts
  #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
  #add_header X-Frame-Options SAMEORIGIN;
  add_header X-Xss-Protection "1; mode=block" always;
  add_header X-Content-Type-Options "nosniff" always;
  #add_header Referrer-Policy "strict-origin-when-cross-origin";
  #add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
  #spdy_headers_comp 5;
  ssl_buffer_size 1369;
  ssl_session_tickets on;

  # 启用 ocsp 装订
  #resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
  #resolver_timeout 10s;
  #ssl_stapling on;
  #ssl_stapling_verify on;
  #ssl_trusted_certificate /usr/local/nginx/conf/ssl/exiges.com/exiges.com-trusted.crt;

# ngx_pagespeed 和 ngx_pagespeed 处理程序
#include /usr/local/nginx/conf/pagespeed.conf;
#include /usr/local/nginx/conf/pagespeedhandler.conf;
#include /usr/local/nginx/conf/pagespeedstatslog.conf;

  # limit_conn limit_per_ip 16;
  # ssi on;

  access_log /home/nginx/domains/exiges.com/log/access.log combined buffer=256k flush=5m;
  error_log /home/nginx/domains/exiges.com/log/error.log;

  include /usr/local/nginx/conf/autoprotect/exiges.com/autoprotect-exiges.com.conf;
  root /home/nginx/domains/exiges.com/public;
  # 如果使用 cloudflare 进行服务器和/或虚拟主机站点，请取消注释 cloudflare.conf include
  include /usr/local/nginx/conf/cloudflare.conf;
  include /usr/local/nginx/conf/503include-main.conf;

location / {
       proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
       proxy_set_header X-Forwarded-Proto https;
       proxy_http_version 1.1;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Real-IP $remote_addr;
   }

  include /usr/local/nginx/conf/php.conf;

  #include /usr/local/nginx/conf/pre-staticfiles-local-exiges.com.conf;
  #include /usr/local/nginx/conf/pre-staticfiles-global.conf;
  #include /usr/local/nginx/conf/staticfiles.conf;
  #include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
  #include /usr/local/nginx/conf/vts_server.conf;
}

```

@david 非常感谢您抽出宝贵时间来解决这个问题。

就我而言，我现在是完全的，证书方面没有灵活性。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023年一月29日 22:09 UTC](https://meta.discourse.org/t/mixed-ssl-since-upgrade/250193/16 "2023-01-29T22:09:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
