# Stopper 1：NGINX 代理混合内容错误

**URL:** https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205
**Category:** Self-hosting
**Tags:** login
**Created:** [2024年六月1日 16:48 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205 "2024-06-01T16:48:55Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![rrodrigueznt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rrodrigueznt/32/351504_2.png) [@rrodrigueznt](https://meta.discourse.org/u/rrodrigueznt)
#### Post date: [2024年六月3日 18:24 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/3 "2024-06-03T18:24:35Z")

</div>

Stopper 1 **已解决** ！所有浏览器（我尝试了 macOS 上的 Firefox、Opera 和 Safari）都不会再显示混合内容消息。Nginx 反向代理中的此更改也解决了我在帖子 [回复主题时遇到问题](https://meta.discourse.org/t/problem-responding-a-topic/297857/3?u=rrodrigueznt) 中描述的问题。

作为参考，我还附上更新后的 Nginx `conf` 文件：

```YAML
server {
    server_name forum.igfae.usc.es;

    location / {
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass "http://172.16.57.96";
    }

    listen 443 ssl; # 由 Certbot 管理
    ssl_certificate /etc/letsencrypt/live/forum.igfae.usc.es/fullchain.pem; # 由 Certbot 管理
    ssl_certificate_key /etc/letsencrypt/live/forum.igfae.usc.es/privkey.pem; # 由 Certbot 管理
    include /etc/letsencrypt/options-ssl-nginx.conf; # 由 Certbot 管理
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # 由 Certbot 管理

}

server {
    if ($host = forum.igfae.usc.es) {
        return 301 https://$host$request_uri;
    } # 由 Certbot 管理

    server_name forum.igfae.usc.es;
    listen 80;
    return 404; # 由 Certbot 管理

}

```

在创建此帖子时，`Nginx/1.20.1` 作为反向代理运行在 `AlmaLinux release 9.4 (Seafoam Ocelot)` 服务器上。

Discourse `3.3.0.beta3-dev` 运行在 `Docker version 26.1.3, build b72abbb` 上，位于 `Ubuntu 22.04.4 LTS` 机器上。

```html
<meta name="generator" content="Discourse 3.3.0.beta3-dev - https://github.com/discourse/discourse version 625c71585623d891751b8abd291337fda3724947">

```

感谢大家！

---

_[View the full topic](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205)._
