새 환경으로 Discourse를 마이그레이트한 후 로그인 시 POST 세션에서 HTTP 403 오류가 발생하고 있습니다. CSRF 문제라고 추측되지만, 현재 디버깅을 어디서 시작해야 할지 막막한 상태입니다. /var/log/discourse-var-log/production.log와 production_error.log 파일 모두 0바이트 상태입니다…
이 문제를 올바르게 디버깅하는 방법에 대한 아이디어가 있으신가요?
현재 구성은 다음과 같습니다:
1. haproxy를 중앙 HTTPS 로드 밸런서/가속기로서 사용 (Discourse 및 기타 서비스 모두 대상)
forum >> develd apache rev. proxy p.82
backend forum-backend
mode http
server forum.netzwissen.de 10.10.10.14:83 cookie A check
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
# HSTS 헤더, 16000000초: 약 6개월 이상
http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"
2. 로컬 apache를 리버스 프록시로 사용
<IfModule proxy_module>
## <https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247>
ProxyPreserveHost On
# ProxyRequests Off
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
RequestHeader set X-Real-IP expr=%{REMOTE_ADDR}
ProxyPass / unix:/var/discourse/shared/web-only/apache.http.sock|http://localhost/
ProxyPassReverse / unix:/var/discourse/shared/web-only/apache.http.sock|http://localhost/
</IfModule>
3) Discourse는 별도의 web_only와 data 컨테이너로 운영되며, web_only는 "templates/web.socketed.template.yml"로 배포됨