No problem. I wish I could help you more, but unfortunately, I do not have enough knowledge on the subject. Hopefully someone that knows more will respond soon. I would also watch the topic that I linked to. It might eventually have a solution posted.
In the mean time, you might want to take a look at your logs and see if there are similarities to the logs posted in that topic. I’m pretty sure the logs you would be interested in can be found by adding /logs to your forum’s base URL. So it would look something like https://example.com/logs The user in that topic also mentions a proxy. Are you using a proxy?
If you can provide this type of information, it should be helpful to someone that reads this topic and has a better understanding on the subject.
We’d prefer if you could upload to try first (try.discourse.org), that way we don’t start getting image uploads all over the place. If the image fails to lightbox on try, then feel free to upload it here so the example doesn’t get deleted when try is reset each day. If the image lightboxes on try then the issue is specific to your configuration as @schungx stated.
경로가 문제가 아니라면, 이 라이트박스(lightbox) 문제를 일으킬 수 있는 다른 원인은 무엇일까요?
경로를 "/var/docker/dis.ctb.co.at"로 되돌려 놓았습니다.
현재의 yml 설정 파일입니다(개인 정보만 변경함). 설정에 문제가 있는 것일 수도 있고, 아니면 Discourse 자체의 문제일까요?
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
# - "80:80" # http
# - "443:443" # https
- "127.0.0.1:3041:80"
docker_args:
- "--network=nginx-br"
params:
db_default_text_search_config: "pg_catalog.english"
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
db_shared_buffers: "4096MB"
## can improve sorting performance, but adds memory usage per-connection
#db_work_mem: "40MB"
## Which Git revision should this container use? (default: tests-passed)
#version: tests-passed
env:
LANG: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override
UNICORN_WORKERS: 8
## TODO: The domain name this Discourse instance will respond to
## Required. Discourse will not work with a bare IP number.
DISCOURSE_HOSTNAME: dis.ctb.co.at
## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config")
#DOCKER_USE_HOSTNAME: true
## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'nothing@nothing.com'
## TODO: The SMTP mail server used to validate new accounts and send notifications
# SMTP ADDRESS, username, and password are required
# WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_ADDRESS: mailserver.nothing.com
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_USER_NAME: nothing@nothing.com
DISCOURSE_SMTP_PASSWORD: "secret"
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
# LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
## The http or https CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
VIRTUAL_HOST: dis.ctb.co.at
VIRTUAL_PORT: 9002
LETSENCRYPT_HOST: dis.ctb.co.at
LETSENCRYPT_EMAIL: nothing@nothing.com
## The Docker container is stateless; all data is stored in /shared
volumes:
- volume:
host: /var/docker/dis.ctb.co.at/shared/standalone
guest: /shared
- volume:
host: /var/docker/dis.ctb.co.at/shared/standalone/log/var-log
guest: /var/log
## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
## Any custom commands to run after building
run:
- exec: echo "Beginning of custom commands"
## If you want to set the 'From' email address for your first registration, uncomment and change:
## After getting the first signup email, re-comment the line. It only needs to run once.
#- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
- exec: echo "End of custom commands"
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: "types {"
to: |
set_real_ip_from 172.18.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
types {
이제야 이 문제가 Force your site to use HTTPS only(사이트에 HTTPS만 사용하도록 강제) 옵션이 활성화된 상태에서 이미지가 포함된 게시글이 생성될 때만 발생한다는 것을 알게 되었습니다.
다른 설치 환경에서는 처음부터 이 옵션이 활성화되어 있었지만, 갑자기 동작을 멈추기 시작했는데, nginx 또는 Discourse 업데이트 때문일 수도 있습니다.
이 nginx 프록시를 통해 Discourse 인스턴스 2개와 Nextcloud 인스턴스를 실행하고 있습니다. 첫 번째 Discourse 설치에서는 라이트박스(lightbox)가 이전에는 작동하다가 갑자기 멈췄습니다. 실제로 프록시 설정은 작동하던 그대로 변경한 적이 없습니다.
흥미롭게도 볼륨을 해당 디렉토리로 설정하지 않았는데도 /var/discourse 안에 일부 파일과 폴더가 여전히 생성되고 있습니다.
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로 다시 이름 변경한 후 모든 것이 정상적으로 작동합니다.