# 1단계: NGINX 프록시 혼합 콘텐츠 오류

**URL:** https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205
**Category:** Self-hosting
**Tags:** login
**Created:** [6월 1, 2024, 4:48오후 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205 "2024-06-01T16:48:55Z")
**Posts on this page:** 7
**Page:** 1

<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: [6월 1, 2024, 4:48오후 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/1 "2024-06-01T16:48:56Z")

</div>

혼합 콘텐츠(mixed-contents) 오류가 지속적으로 발생하여 해결 방법을 도와주실 분을 찾습니다.

AlmaLinux 9.4에서 실행 중인 Nginx를 사용하여 Ubuntu 22.04에서 구동되는 Discourse(표준 Docker 버전 26.1.3, 빌드 b72abbb)를 리버스 프록시하고 있습니다. `force https`를 설정하면 로그인할 수 없습니다. 이는 [이전 스레드](https://meta.discourse.org/t/problem-responding-a-topic/297857)에 설명된 상황과 동일합니다.

이 문제를 관리 가능한 부분으로 나누기 위한 체계적인 접근법을 찾고 있습니다. 이 과정에서 여러분의 조언과 통찰은 매우 가치 있을 것입니다.

**Discourse** 는 인상적인 소프트웨어입니다. 우리의 작은 연구소를 포함해 점점 더 많은 기업에서 토론을 지식으로 전환하는 데 기여하고 있습니다. 몇 달 동안 테스트를 해왔고, 몇 가지 문제가 있었지만 여러분의 도움 덕분에 극복했습니다.

이를 문명화된 토론의 표준으로 제안하고 싶지만, 그렇게 하기 전에 이러한 겉보기에 간단한 문제를 해결하지 못하는 이유를 설명해야 합니다. 여러분의 도움이 매우 반갑습니다! **도움 주셔서 감사합니다!**

---

<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: [6월 3, 2024, 3:57오후 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/2 "2024-06-03T15:57:49Z")

</div>

> [@Problems with Force https and mixed https content](https://meta.discourse.org/t/problems-with-force-https-and-mixed-https-content/118337/21?u=rrodrigueznt):
>
> I guess someone else already said it, our devops fixed it by patching nginx. proxy\_set\_header X-Forwarded-Proto $scheme;

이 스레드는 HTTPS를 강제하고 로그인 및 기타 모든 작업이 정상적으로 작동하는 방법을 해결합니다. 지금까지 테스트해 본 범위 내에서 말이죠.

다만 여전히 일부 혼합 콘텐츠 오류 메시지가 발생합니다. 계속 조사하고 이 주제를 업데이트하겠습니다.

감사합니다!

---

<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: [6월 3, 2024, 6:24오후 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/3 "2024-06-03T18:24:35Z")

</div>

Stopper 1 **해결**! 이제 어떤 브라우저(Firefox, Opera, macOS의 Safari를 시도해 보았습니다)에서도 혼합 콘텐츠(mixed content) 메시지가 더 이상 표시되지 않습니다. 이 Nginx 리버스 프록시 변경 사항은 제가 이전 게시글 [Problem Responding to a Topic](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; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/forum.igfae.usc.es/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/forum.igfae.usc.es/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

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

    server_name forum.igfae.usc.es;
    listen 80;
    return 404; # managed by Certbot

}

```

이 게시글을 작성하는 시점, `Nginx/1.20.1`이 `AlmaLinux release 9.4 (Seafoam Ocelot)` 서버에서 리버스 프록시로 실행 중입니다.

Discourse `3.3.0.beta3-dev`는 `Ubuntu 22.04.4 LTS` 머신에서 `Docker version 26.1.3, build b72abbb`로 실행 중입니다.

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

```

모두 감사합니다!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [6월 3, 2024, 6:59오후 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/4 "2024-06-03T18:59:18Z")

</div>

> [@rrodrigueznt](#):
>
> `proxy_set_header X-Forwarded-Proto $scheme;`

https로 하드코딩해 보세요:

`proxy_set_header X-Forwarded-Proto https;`

---

<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: [6월 12, 2024, 8:55오전 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/5 "2024-06-12T08:55:27Z")

</div>

> [@RGJ](#):
>
> `https`로 하드코딩해 보세요

이 제안이 이해가 잘 안 되었습니다. `$scheme`가 작동하는데 왜 굳이 `https`로 하드코딩해야 하는 건가요? 감사합니다!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [6월 12, 2024, 9:18오전 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/6 "2024-06-12T09:18:01Z")

</div>

잘 읽지 못했어요.

---

<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: [7월 12, 2024, 9:18오전 UTC](https://meta.discourse.org/t/stopper-1-nginx-proxy-mixed-content-error/310205/7 "2024-07-12T09:18:36Z")

</div>

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