I have a site “forum.6figureswithchris.com” it was working fine behind a proxy port 8080 and I have apache on port 80 but suddenly it gives “502 bad gateway”
##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:
- "8080:80" # http
#- "444:443" # https
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: "256MB"
## 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: 3
## TODO: The domain name this Discourse instance will respond to
## Required. Discourse will not work with a bare IP number.
DISCOURSE_HOSTNAME: 'forum.7figureswithchris.com'
## 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: 'admin@epcmarketer.com,admin@6figureswithchris.com,admin@7figureswithchris.com,admin@chrisfrevillereview.com,admin@chrisfrevillereviews.com,admin@christopherfreville.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: host.epcmarketer.com
#DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: admin@epcmarketer.com
DISCOURSE_SMTP_PASSWORD: **no#**
DISCOURSE_SMTP_ENABLE_START_TLS: false
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
# no # in password
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
## The CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: //discourse-cdn.example.com
## The Docker container is stateless; all data is stored in /shared
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
after_postgres:
- exec: sudo -u postgres createdb discourse_dbase1 || exit 0
- exec: sudo -u postgres createdb discourse_dbase2 || exit 0
- exec: sudo -u postgres createdb discourse_dbase3 || exit 0
- exec: sudo -u postgres createdb discourse_dbase4 || exit 0
- exec: sudo -u postgres createdb discourse_dbase5 || exit 0
- exec:
stdin: |
grant all privileges on database discourse_dbase1 to discourse;
grant all privileges on database discourse_dbase2 to discourse;
grant all privileges on database discourse_dbase3 to discourse;
grant all privileges on database discourse_dbase4 to discourse;
grant all privileges on database discourse_dbase5 to discourse;
cmd: sudo -u postgres psql discourse_dbase1
raise_on_fail: false
cmd: sudo -u postgres psql discourse_dbase2
raise_on_fail: false
cmd: sudo -u postgres psql discourse_dbase3
raise_on_fail: false
cmd: sudo -u postgres psql discourse_dbase4
raise_on_fail: false
cmd: sudo -u postgres psql discourse_dbase5
raise_on_fail: false
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase1 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase1 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase1 <<< "create extension if not exists pg_trgm;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase2 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase2 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase2 <<< "create extension if not exists pg_trgm;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase3 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase3 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase3 <<< "create extension if not exists pg_trgm;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase4 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase4 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase4 <<< "create extension if not exists pg_trgm;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase5 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase5 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_dbase5 <<< "create extension if not exists pg_trgm;"'
after_code:
- exec:
echo: "hey!"
before_bundle_exec:
- file:
path: /var/www/discourse/config/multisite.yml
contents: |
discourse_instance2:
adapter: postgresql
database: discourse_dbase2
pool: 25
timeout: 5000
db_id: 2
host_names:
- forum.6figureswithchris.com
discourse_instance3:
adapter: postgresql
database: discourse_dbase3
pool: 25
timeout: 5000
db_id: 3
host_names:
- forum.chrisfrevillereview.com
discourse_instance4:
adapter: postgresql
database: discourse_dbase4
pool: 25
timeout: 5000
db_id: 4
host_names:
- forum.chrisfrevillereviews.com
discourse_instance5:
adapter: postgresql
database: discourse_dbase5
pool: 25
timeout: 5000
db_id: 5
host_names:
- forum.christopherfreville.com
after_bundle_exec:
- exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
## 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"
Here are the outputs of “free -m” and “df -m”:
total used free shared
buff/cache available
Mem: 1873 1263 64 48 545 338
Swap: 1999 1177 822
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/vda3 38221 27744 8514 77% /
devtmpfs 927 0 927 0% /dev
tmpfs 937 1 937 1% /dev/shm
tmpfs 937 10 928 1% /run
tmpfs 937 0 937 0% /sys/fs/cgroup
tmpfs 188 0 188 0% /run/user/0
/dev/loop0 3904 514 3186 14% /tmp
overlay 38221 27744 8514 77% /var/lib/docker/overlay2/b217295203dbf619158c49bd476d34ea83f121737016f263af1777318d43232b/merged
shm 512 1 512 1% /var/lib/docker/containers/683ec51e28f18b77d9053e63203decaf4b8141cc0749a066f0909476c870b57c/mounts/shm
Here is a snippet of httpd.conf:
<VirtualHost 72.52.244.147:80>
ServerName forum.6figureswithchris.com
DocumentRoot /home/mercury/forum.6figureswithchris.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
and here is the httpd error_log file snippet:
[Thu Jul 05 22:32:15.028092 2018] [proxy:error] [pid 46868] [client 123.201.41.40:57760] AH00898: Error reading from remote server returned by /favicon.ico, referer: http://forum.6figureswithchris.com/
[Thu Jul 05 22:32:16.034055 2018] [proxy_http:error] [pid 46868] (104)Connection reset by peer: [client 123.201.41.40:57760] AH01102: error reading status line from remote server 0.0.0.0:8080, referer: http://forum.6figureswithchris.com/
[Thu Jul 05 22:32:16.034106 2018] [proxy:error] [pid 46868] [client 123.201.41.40:57760] AH00898: Error reading from remote server returned by /502.shtml, referer: http://forum.6figureswithchris.com/
The things I have tried:
1)Rebuilding app, restarting vps, completely reinstalling everything from scratch
2)Tried adding to httpd.conf and failed with all these:
Timeout 2400
ProxyTimeout 2400
ProxyBadHeader Ignore
ProxyPass / http://0.0.0.0:8080/ retry=1 acquire=3000 timeout=600 Keepalive=On
3)./launcher cleanup
Image of error: