# 서브폴더 설치에서 「전체 게시물 보기」 버튼이 작동하지 않음

**URL:** https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811
**Category:** Support
**Tags:** embedding, subfolder
**Created:** [12월 9, 2025, 6:21오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811 "2025-12-09T18:21:00Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [12월 15, 2025, 10:05오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/22 "2025-12-15T22:05:16Z")

</div>

> [@Thiago\_Mobilon](#):
>
> Discourse가 데이터를 가져오기 위해 적어도 하나 또는 두 번의 리다이렉트를 따를 수 없나요?

가능합니다 🙂

해당 인스턴스에 접근할 수 있나요? 그렇다면 다음 명령을 실행하고 결과를 알려주실 수 있을까요:

```plaintext
./launcher enter app
rails c
TopicEmbed.find_by(topic_id: 157441).as_json

```

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [12월 16, 2025, 6:12오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/23 "2025-12-16T18:12:23Z")

</div>

```plaintext
discourse(prod)> TopicEmbed.find_by(topic_id: 157441).as_json
ActiveRecord 모델(TopicEmbed)을 직렬화할 때 필드를 지정하지 않는 것은 허용되지 않습니다. Serializer를 사용하거나 #serializable_hash에 :only 옵션을 전달하세요. 자세한 정보: ``https://meta.discourse.org/t/-/314495
=>
{“id”=>56685,
“topic_id”=>157441,
“post_id”=>483289,
“embed_url”=>
“``https://tecnoblog.net/noticias/paramount-oferece-us-108-bilhoes-em-dinheiro-para-tomar-warner-da-netflix”``,
“content_sha1”=>nil,
“created_at”=>“2025-12-08T17:54:07.585Z”,
“updated_at”=>“2025-12-09T18:04:33.539Z”,
“deleted_at”=>nil,
“deleted_by_id”=>nil,
“embed_content_cache”=>“”}
discourse(prod)>

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [12월 17, 2025, 8:54오전 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/24 "2025-12-17T08:54:29Z")

</div>

공유하기 전에 출력을 편집했나요? `embed_url` 값만 봐도

```plaintext
“``https://tecnoblog.net/noticias/paramount-oferece-us-108-bilhoes-em-dinheiro-para-tomar-warner-da-netflix”``

```

이런 상태입니다.

같은 명령어를 다시 실행해 주시겠어요? 이번에는 아래처럼요:

```plaintext
./launcher enter app
rails c
TopicEmbed.find_by(topic_id: 157441).embed_url

```

공유하신 내용이 실제로 db의 `embed_url` 값이라면, 이것이 문제의 원인입니다. `embed_url`이 잘못된 형태로 저장된 것과 같은 엣지 케이스를 처리하기 위해 `discourse/discourse`에 작은 PR을 만들겠습니다.

> <https://github.com/discourse/discourse/pull/36753>
>
> See https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-…installations/390811

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [12월 17, 2025, 6:31오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/25 "2025-12-17T18:31:09Z")

</div>

> [@angus](#):
>
> 공유하기 전에 출력을 수정했나요? 단순히 `embed_url` 값만 봐도

아니요! 여기 그대로 복사해서 붙여넣었습니다.

URL 앞뒤의 백틱은 아마 이 토픽에서 코드 버튼을 사용하여 텍스트를 서식 설정하려다 생긴 오류일 것 같습니다.

> [@Thiago\_Mobilon](#):
>
> `“``https://tecnoblog.net/noticias/paramount-oferece-us-108-bilhoes-em-dinheiro-para-tomar-warner-da-netflix”``,`

> [@angus](#):
>
> 같은 명령어를 다시 실행해 주실 수 있나요?

`discourse(prod)> TopicEmbed.find_by(topic_id: 157441).embed_url`  
`=> “https://tecnoblog.net/noticias/paramount-oferece-us-108-bilhoes-em-dinheiro-para-tomar-warner-da-netflix”`  
`discourse(prod)>`

여기서 Embed JS를 사용하여 생성된 토픽을 볼 수 있습니다:

> **[Microsoft Edge ganha Copilot Mode, que promete realizar tarefas usando IA •...](https://tecnoblog.net/comunidade/t/microsoft-edge-ganha-copilot-mode-que-promete-realizar-tarefas-usando-ia-tecnoblog/157661)**
>
> A Microsoft anunciou, nesta segunda-feira (28/07), a chegada do Copilot Mode ao navegador Edge. O recurso usa inteligência artificial para executar diversas tarefas, como fazer reservas, comparar hotéis ou resumir vantagens de diferentes...

이 토픽에서도 “전체 게시물 보기” 기능이 작동하지 않습니다.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 17, 2025, 6:57오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/26 "2025-12-17T18:57:13Z")

</div>

> [@angus](#):
>
> 여러분, 다시 한 번 뒤쪽 슬래시(trailing slash) 문제가 발생했네요 🙂
> 
> > [뒤쪽 슬래시가] 주된 문제인 것 같습니다. [Javascript를 통해 다른 웹사이트에 Discourse 코멘트를 임베드](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963)할 때는 파라미터로 제어할 수 있으며, 수정하는 것이 매우 쉽습니다.
> 
> 참고로 Discourse의 모든 토픽 임베드에서는 `embed_url`에서 뒤쪽 슬래시를 제거합니다. [TopicEmbed.normalize\_url](https://github.com/discourse/discourse/blob/main/app/models/topic_embed.rb#L30)을 참조하세요. JavaScript 임베드와 [WP Discourse](https://github.com/discourse/wp-discourse) 임베드의 교차점에서 발생한 별개의 사례로 인해, 두 임베드 방식 모두에서 이 처리 방식을 표준화했습니다. [Apply TopicEmbed url normalisation to embed urls inserted in the PostCreator by angusmcleod · Pull Request #30641 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/30641)를 확인하세요.

그러면 이번 문제의 전부가 올해 1월에 위 PR이 TopicEmbed에서 뒤쪽 슬래시를 제거하기 시작했기 때문인가요? 이 변경 사항에 대해 갈등을 느끼고 있습니다. 솔직히 관리자님이 보내준 값을 그대로 존중하는 편이 더 좋겠습니다.

> [@angus](#):
>
> > [@Thiago\_Mobilon](#):
> >
> > Discourse가 데이터를 가져오기 위해 리다이렉트를 최소 1~2회 따를 수는 없나요?
> 
> 그렇게 하고 있습니다 🙂

이것이 우리 문제의 근본 원인이라고 생각합니다.

@Thiago_Mobilon 님, 다음 코드를 실행해 주시겠어요?

```ruby
url = "https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento"

fd = FinalDestination.new(url, validate_uri: true, max_redirects: 5, follow_canonical: true)

uri = fd.resolve

puts uri

html = FinalDestination::HTTP.get(uri)

puts html.truncate(200)

```

`fd.resolve`는 `puts uri` 라인에서 뒤쪽 슬래시를 추가할 수 있어야 합니다. 실패하는 것 같아 우려됩니다.

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [12월 17, 2025, 9:10오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/27 "2025-12-17T21:10:31Z")

</div>

```plaintext
discourse(prod)> url = "https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento"
discourse(prod)> 
discourse(prod)> fd = FinalDestination.new(url, validate_uri: true, max_redirects: 5, follow_canonical: true)
discourse(prod)> 
discourse(prod)> uri = fd.resolve
discourse(prod)> 
discourse(prod)> puts uri
discourse(prod)> 
discourse(prod)> html = FinalDestination::HTTP.get(uri)
discourse(prod)> 
discourse(prod)> puts html.truncate(200)
https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento

=> nil

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 17, 2025, 9:21오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/28 "2025-12-17T21:21:48Z")

</div>

실제로 리디렉트를 따르지 않고 있습니다. 포럼이 블로그와 동일한 서버/IP 공간에서 실행되고 있나요? 그렇게 되면 SSRF 보호 기능이 트리거될 수 있습니다.

그렇다면 `allowed_internal_hosts` 설정을 통해 허용해야 합니다.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [12월 17, 2025, 10:26오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/29 "2025-12-17T22:26:46Z")

</div>

> [@Falco](#):
>
> 그러니까 이번 문제의 근본적인 원인은 올해 1월에 시작되어 TopicEmbed에서 끝부분 슬래시를 제거하기 시작한 위의 PR 때문이라는 건가요?

참고로

> [@angus](#):
>
> 부연 설명을 덧붙이자면, 최신 버전의 Discourse에서 이 두 명령어를 로컬로 실행했을 때 동일한 결과가 나와요. 즉, 기사의 HTML 본문이 반환됩니다.
> 
> ```plaintext
> # 끝부분 슬래시 포함
> TopicEmbed.find_remote("https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento/")
> 
> # 끝부분 슬래시 미포함
> TopicEmbed.find_remote("https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento")
> 
> # 동일한 결과 생성
> 
> ```

> [@Falco](#):
>
> 이 변경 사항에 대해 마음이 복잡합니다. 솔직히 말해서, 관리자가 보내준 값을 존중하는 쪽이 더 좋았을 것 같아요.

그 변경 사항을 수행한 이유는 [WP Discourse](https://github.com/discourse/wp-discourse) 임베드와 자바스크립트 임베드의 동작 방식 사이에 일관성이 없었기 때문입니다. 자바스크립트 임베드는 항상 URL을 정규화(normalise)해 왔지만, [WP Discourse](https://github.com/discourse/wp-discourse) 임베드는 다른 경로를 통해 들어와 URL을 정규화하지 않았습니다(우리가 변경하기 전까지는요). 이로 인해 다른 일관성 문제들이 발생했습니다.

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [12월 18, 2025, 4:58오전 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/30 "2025-12-18T04:58:08Z")

</div>

> [@Falco](#):
>
> 그렇다면 `allowed_internal_hosts` 설정을 통해 이를 허용해야 합니다.

이렇게 말씀하시는 건가요? (이미 이렇게 되어 있었습니다)

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

> [@Falco](#):
>
> 포럼이 블로그와 동일한 서버/IP 공간에서 실행되고 있나요?

아니요, 전용 VPS에 있습니다. 블로그 머신이 서브디렉토리의 트래픽(nginx)을 discourse VPS로 프록시하고 있습니다.

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [12월 18, 2025, 6:31오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/31 "2025-12-18T18:31:08Z")

</div>

> [@angus](#):
>
> 이로 인해 다른 불일치 문제들이 발생했습니다.

또 다른 문제는 API에 curl 요청을 보낼 때, 임베드 URL의 주제 ID를 검색하면 끝부분의 슬래시 때문에 해당 ID를 찾을 수 없다는 점입니다. Discourse가 404 페이지를 반환합니다.

하지만 끝부분의 슬래시를 제거하면 값을 반환합니다:

```plaintext
mobilon@Thiagos-MacBook-Pro ~ % curl 'https://tecnoblog.net/comunidade/embed/info?embed_url=https://tecnoblog.net/noticias/anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina/' -H 'API-KEY: <API KEY>' -H 'API-USERNAME: <USERNAME>'

<!DOCTYPE html>

<html lang="pt-BR">

<head>

  <meta charset="utf-8">

  <title>Página não encontrada - Tecnoblog Comunidade</title>

```

```plaintext
mobilon@Thiagos-MacBook-Pro ~ % curl 'https://tecnoblog.net/comunidade/embed/info?embed_url=https://tecnoblog.net/noticias/anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina' -H 'API-KEY: <API KEY>' -H 'API-USERNAME: <USERNAME>' 

{"topic_id":157645,"post_id":484103,"topic_slug":"anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina-tecnoblog","comment_count":15}%     

```

이를 작동시키려면 확인 전에 워드프레스에서 영구 링크의 끝부분 슬래시를 제거하는 문자열 대체를 수행해야 합니다. 하지만 이는 말이 되지 않습니다. 정준 URL(canonical URL)에는 끝부분 슬래시가 포함되어 있거든요…

실제로 Discourse는 존재하지 않는 URL로 영구 링크를 정규화하고 있습니다… 정규화된 버전은 끝부분 슬래시가 있는 것이어야 합니다.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 18, 2025, 7:36오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/32 "2025-12-18T19:36:49Z")

</div>

@Thiago_Mobilon 덕분에 문제를 찾았고, 수정안을 제안했습니다

> <https://github.com/discourse/discourse/pull/36785>
>
> For subfolder installs (e.g. \`example.com/forum\`), \`FinalDestination\` was ignori…ng all URLs on the parent domain instead of just URLs under the subfolder path.
> 
> \### Problem
> 
> When Discourse is installed in a subfolder like \`https://tecnoblog.net/comunidade/\`, attempting to onebox/fetch URLs like \`https://tecnoblog.net/noticias/...\` (WordPress blog on same domain) would fail because FinalDestination immediately returned without making any HTTP request.
> 
> \### Cause
> 
> \- \`Discourse.base\_url\_no\_prefix\` returns just \`https://tecnoblog.net\` (no path)
> \- Only hostnames were stored in the ignored list
> \- Any URL on \`tecnoblog.net\` matched and was ignored
> 
> \### Fix
> 
> \- Use \`Discourse.base\_url\` which includes the subfolder path
> \- Store both hostname and path in the ignored list
> \- Check both hostname AND path prefix when determining if a URL should be ignored
> 
> \### Security
> 
> SSRF protection is unaffected - it runs after the ignored check, so URLs that are no longer ignored still go through IP validation. Added a test to verify this.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 23, 2025, 10:03오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/33 "2025-12-23T22:03:42Z")

</div>

@Thiago_Mobilon 수정이 완료되었습니다. 업데이트해 주시겠어요?

---

<div class="post-metadata">

### Author: ![Thiago\_Mobilon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thiago_mobilon/32/177756_2.png) [@Thiago\_Mobilon](https://meta.discourse.org/u/Thiago_Mobilon)
#### Post date: [1월 2, 2026, 4:38오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/34 "2026-01-02T16:38:23Z")

</div>

> [@Falco](#):
>
> @Thiago_Mobilon 수정이 완료되었습니다. 업데이트해 주시겠어요?

동작합니다, Falco님 감사합니다!

하지만 이전 게시물에서 언급한 이유 때문에, 끝부분에 슬래시가 없는 URL에 대해 여전히 우려가 있습니다. 이 문제에 대해 @angus님에게 새 주제를 여는 것이 좋을까요?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1월 2, 2026, 4:39오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/35 "2026-01-02T16:39:42Z")

</div>

> [@Thiago\_Mobilon](#):
>
> > [@Falco](#):
> >
> > @Thiago_Mobilon 수정이 적용되었습니다. 업데이트해 주시겠어요?
> 
> 정상 작동합니다. 감사합니다, Falco!

감사합니다. 기쁜 소식입니다.

> [@Thiago\_Mobilon](#):
>
> 하지만 이전 게시물에서 언급한 이유로 인해, 끝부분에 슬래시가 없는 URL에 대해서는 여전히 우려가 있습니다. 이 문제에 대해 @angus 님에게 새 주제를 여는 것이 좋을까요?

물론입니다! 이제 포럼과 동일한 도메인 내 사이트의 리다이렉트를 따라갈 수 있으므로 ‘Full Post’ 기능에는 영향을 주지 않습니다. 하지만 다른 우려 사항에 대해서는 새 주제에서 후속 조치를 취하셔도 됩니다.

[이전 페이지](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811.md?page=1)
