로그 파일에 /uploads/....에 접근할 수 없다는 오류가 표시됩니다.
Can't reach '/uploads/default/original/1X/fe2af548af4a22f4802ddaa54afa557417c.png' to get its dimension.
웹 브라우저에 URL을 직접 입력하면 이미지에 문제없이 접근할 수 있습니다:
https://domain.com/uploads/default/original/1X/fe2af548af4a22f4802ddaa54afa557417c.png
Completed 200 OK in 23ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 3000)
Completed 200 OK in 318ms (Views: 1.2ms | ActiveRecord: 0.0ms | Allocations: 50347)
Can't reach '/uploads/default/original/1X/fe2af548af4a22f4802ddaa54afa557417c.png' to get its dimension.
Started GET "/posts/96" for 84.115.50.36 at 2020-07-04 14:15:14 +0000
Processing by PostsController#show as JSON
Parameters: {"id"=>"96"}
https가 강제되지 않으면 오류가 표시되지 않습니다.
Completed 200 OK in 18ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 3050)
Completed 200 OK in 296ms (Views: 0.5ms | ActiveRecord: 0.0ms | Allocations: 49562)
Started GET "/posts/97" for 84.115.50.36 at 2020-07-04 14:17:43 +0000
Processing by PostsController#show as JSON
Parameters: {"id"=>"97"}
제 생각에는 Discourse가 어떤 이유로든 라이트박스(lightbox) 관련 작업을 수행하기 위해 웹서버에서 이미지를 다시 다운로드하는 것 같습니다.
Discourse Docker 컨테이너 내에서 이 이미지를 수동으로 다운로드하면, 프록시를 통해 접근하는 대신 내부 IP 주소를 통해 웹서버에 직접 접근을 시도합니다. 이는 http로 작동하지만, https로는 작동하지 않습니다.
웹서버 자체에는 http만 사용 가능하지만, Discourse는 https를 통해 접근을 시도하다가 실패합니다.
http/https 없이 내부적으로 접근하는 대신 왜 Discourse가 웹서버에서 사진을 다시 다운로드하는지 궁금합니다.
수정: app.yml을 domain.name.yml로 이름 변경한 것이 원인인 것으로 확인되었습니다. 이로 인해 Docker가 domain.name의 DNS 이름을 내부 IP 주소로 변경했습니다. 이를 domain_name.yml로 다시 이름 변경한 후 모든 것이 정상적으로 작동합니다.