해결됨: nginx 서버를 비활성화하고, discourse-setup을 실행한 후, nginx 서버를 다시 활성화하고 앱을 재빌드했습니다.
안녕하세요. 이 가이드에 따라 Discourse를 설치하려고 하고 있습니다.
다음은 제가 편집한 app.yml 파일입니다 (discourse 폴더에서 복사하여 가이드에 따라 편집함):
templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/web.template.yml" - "templates/web.ratelimited.template.yml" - "templates/web.socketed.template.yml" ## Lets Encrypt(https)를 추가하려면 이 두 줄을 주석 해제하세요 # - "templates/web.ssl.template.yml" # - "templates/web.letsencrypt.ssl.template.yml" ## 이 컨테이너가 어떤 TCP/IP 포트를 노출해야 하나요? ## Discourse가 Apache나 nginx 같은 다른 웹서버와 포트를 공유하려면, ## 자세한 내용은 https://meta.discourse.org/t/17247 를 참조하세요 expose: # - "80:80" # http # - "2222:22" # - "443:443" # https
제 discourse.conf nginx 블록은 다음과 같습니다:
server {
server_name forum.myhost; # listen [::]:443 ssl http2 ipv6only=on; # Certbot에 의해 관리됨 listen 443 ssl http2; # Certbot에 의해 관리됨 ssl_certificate /etc/letsencrypt/live/forum.myhost/fullchain.pem; # Certbot에 의해 관리됨 ssl_certificate_key /etc/letsencrypt/live/forum.myhost/privkey.pem; # Certbot에 의해 관리됨 include /etc/letsencrypt/options-ssl-nginx.conf; # Certbot에 의해 관리됨 ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # Certbot에 의해 관리됨 ssl on; http2_idle_timeout 5m; # 기본값 3m에서 증가; location / { proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock; proxy_set_header Host $http_host; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Real-IP $remote_addr; } } server { if ($host = forum.myhost) { return 301 https://$host$request_uri; } # Certbot에 의해 관리됨 server_name www.forum.myhost; return 301 $scheme://forum.myhost$request_uri; listen 80; listen [::]:80; server_name forum.myhost; return 404; # Certbot에 의해 관리됨 }
서버는 SSL(Certbot 설치됨)로 작동하며, 주 도메인에서는 http를 https로 리디렉션하지만 포럼 도메인에서는 502 Gateway 오류가 표시됩니다. Cloudflare(성능 또는 보안 옵션 활성화 없이)를 사용하고 있습니다.
어떤 도움이든 감사하겠습니다. 이 문제를 해결하기 위한 정보를 위해 "Google: “open ports YOUR CLOUD SERVICE”"라고 표시되므로 discourse-setup을 실행할 수 없습니다.
방화벽도 확인했습니다.
수정: 이 줄에 문제가 있는 것일까요? (이 파일을 폴더에서 찾을 수 없습니다)
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;