After I configure the installation as a subfolder, the admin dashboard cannot view the charts
My app.yml file:
templates:
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.socketed.template.yml"
expose:
# - "80:80" # http
# - "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
DISCOURSE_DEFAULT_LOCALE: en
DISCOURSE_DB_USERNAME: username
DISCOURSE_DB_PASSWORD: password
DISCOURSE_DB_HOST: db.example.com
DISCOURSE_DB_NAME: discourse
DISCOURSE_HOSTNAME: 'www.example.com'
DISCOURSE_RELATIVE_URL_ROOT: /forum
DISCOURSE_FORCE_HTTPS: true
DISCOURSE_DEVELOPER_EMAILS: 'dev@example.com'
DISCOURSE_SMTP_ADDRESS: email.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: username
DISCOURSE_SMTP_PASSWORD: password
DISCOURSE_NOTIFICATION_EMAIL: noreply@example.com
volumes:
- volume:
host: /opt/discourse/shared/standalone
guest: /shared
- volume:
host: /opt/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-adplugin.git
- git clone https://github.com/discourse/discourse-solved.git
- git clone https://github.com/discourse/discourse-reactions.git
run:
- exec: echo "Beginning of custom commands"
- exec:
cd: $home
cmd:
- mkdir -p public/forum
- cd public/forum && ln -s ../uploads && ln -s ../backups
- replace:
global: true
filename: /etc/nginx/conf.d/discourse.conf
from: proxy_pass http://discourse;
to: |
rewrite ^/(.*)$ /forum/$1 break;
proxy_pass http://discourse;
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: etag off;
to: |
etag off;
location /forum {
rewrite ^/forum/?(.*)$ /$1;
}
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: $proxy_add_x_forwarded_for
to: $http_x_real_ip
global: true
- exec: rails r "SiteSetting.notification_email='noreply@example.com'"
- exec: echo "End of custom commands"
nginx configuration for domain www.example.com
:
server
{
listen 443 ssl http2;
server_name www.example.com;
ssl_certificate_key /opt/nginx/certs/example.com.key;
ssl_certificate /opt/nginx/certs/example.com.crt;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# ...
location ~ ^/forum {
proxy_pass http://unix:/opt/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;
proxy_set_header Accept-Encoding $http_accept_encoding;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
DevTools shows request failure like:
DevTools failed to load source map: Could not load content for https://www.example.com/forum/assets/start-discourse-ad6df1f90fead75ae210773db99bd88b11531a12b1facaf51e5e1ee650a2cf79.map: Connection error: net::ERR_CONNECTION_CLOSED
...
The FetchEvent for "https://www.example.com/forum/admin/reports/bulk?reports%5Bvisits%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bvisits%5D%5Bstart_date%5D=2022-06-06&reports%5Bvisits%5D%5Bend_date%5D=2022-07-06&reports%5Btime_to_first_response%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Btime_to_first_response%5D%5Bstart_date%5D=2022-06-06&reports%5Btime_to_first_response%5D%5Bend_date%5D=2022-07-06&reports%5Blikes%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Blikes%5D%5Bstart_date%5D=2022-06-06&reports%5Blikes%5D%5Bend_date%5D=2022-07-06&reports%5Bflags%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bflags%5D%5Bstart_date%5D=2022-06-06&reports%5Bflags%5D%5Bend_date%5D=2022-07-06" resulted in a network error response: the promise was rejected.
NetworkFirst.mjs:167 Uncaught (in promise) no-response: no-response :: [{"url":"https://www.example.com/forum/admin/reports/bulk?reports%5Bvisits%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bvisits%5D%5Bstart_date%5D=2022-06-06&reports%5Bvisits%5D%5Bend_date%5D=2022-07-06&reports%5Btime_to_first_response%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Btime_to_first_response%5D%5Bstart_date%5D=2022-06-06&reports%5Btime_to_first_response%5D%5Bend_date%5D=2022-07-06&reports%5Blikes%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Blikes%5D%5Bstart_date%5D=2022-06-06&reports%5Blikes%5D%5Bend_date%5D=2022-07-06&reports%5Bflags%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Bflags%5D%5Bstart_date%5D=2022-06-06&reports%5Bflags%5D%5Bend_date%5D=2022-07-06"}]
at a.makeRequest (https://www.example.com/forum/javascripts/workbox/workbox-strategies.prod.js:1:2145)
...