대상 URL은 https://discourse.example.com:9443입니다.
다른 서버에서 이 설정을 사용하여 리버스 프록시(nginx)를 사용하고 있습니다:
스푸일러
server {
listen 9443 ssl;
listen [::]:9443 ssl;
client_max_body_size 500m;
server_name discourse.example.com;
ssl_certificate /etc/ssl/certs/example.com.pem;
ssl_certificate_key /etc/ssl/private/example.com.key;
location / {
proxy_pass http://10.250.26.133:3080/;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
그리고 이 containers/app.yml 파일입니다:
스푸일러
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
expose:
- "3080:80" # http
- "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
db_shared_buffers: "2048MB"
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
UNICORN_WORKERS: 8
DISCOURSE_HOSTNAME: discourse.example.com
DISCOURSE_PORT: 9443 # <- 이 부분은 작동하지 않습니다
#DOCKER_USE_HOSTNAME: true
DISCOURSE_DEVELOPER_EMAILS: 'admin@example.com'
DISCOURSE_SMTP_ADDRESS: smtp.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: example-username
DISCOURSE_SMTP_PASSWORD: "p@ssw0rd"
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_ENABLE_START_TLS: true # (선택 사항, 기본값 true)
DISCOURSE_SMTP_DOMAIN: example.com
DISCOURSE_NOTIFICATION_EMAIL: discourse@example.com
LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-oauth2-basic.git
run:
- exec: echo "Beginning of custom commands"
- exec: echo "End of custom commands"
./launcher rebuild app을 실행합니다.
그 후 https://discourse.example.com:9443 URL이 정상적으로 작동합니다.
하지만
-
Discourse가 9443 포트가 없는 URL로 리다이렉트하기 때문에 관리자 사용자를 생성할 수 없었습니다.
콘솔을 통해 관리자를 생성해야 했습니다(./launcher enter app실행 후rake admin:create실행). -
동일한 이유로 다른 사용자를 등록할 수 없었습니다.
-
Discourse가 잘못된 redirect_uri(9443 포트가 누락된 URL)로 authorize URL을 생성하기 때문에 Gitea OAuth로 연결할 수 없었습니다.
DISCOURSE_HOSTNAME 옆에 DISCOURSE_PORT를 지정할 수 있는 방법이 있을까요?