解決済み: nginx サーバーを無効化し、discourse-setup を実行、nginx サーバーを有効化し、アプリを再構築しました。
こんにちは。このガイド に従って Discourse をインストールしようとしています。
以下が、Discourse フォルダーからコピーし、ガイドに従って編集した app.yml です:
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) を追加したい場合は、以下の 2 行のコメントを外してください # - "templates/web.ssl.template.yml" # - "templates/web.letsencrypt.ssl.template.yml" ## このコンテナが公開する TCP/IP ポートはどれですか? ## Discourse を Apache や nginx などの他の Web サーバーとポートを共有したい場合は、 ## 詳細については 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 へのリダイレクトが機能していますが、forum ドメインでは 502 Gateway エラーが表示されます。Cloudflare を使用していますが、パフォーマンスやセキュリティオプションは有効にしていません。
どのようなサポートでも大変助かります。discourse-setup を実行しようとすると、「Google: 「YOUR CLOUD SERVICE のポートを開く」について、この問題を解決するための情報」と表示されて実行できません。
ファイアウォールも確認しました。
編集: この行が問題かもしれませんか?(フォルダーにこのファイルが見当たりません)
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;