pfaffman
(Jay Pfaffman)
June 26, 2019, 1:42pm
#7
If you have a backup from then you might be able to do a new build and put the Verdun you want in the version line.
You might try entering the container and doing a
rake assets:precompile
My current subfolder solution is with traefik as the reverse proxy. I offer that installation as a service if you’re interested.
1 Like
john3
(Johnny)
June 27, 2019, 6:19pm
#8
Currently, I am trying a fresh installation first, as you can see in the first post even the registration page is not working fine. I have tried assets:precompile
but its same no effect. Is there a way I can try to install an older version of discourse docker?
pfaffman
(Jay Pfaffman)
June 27, 2019, 6:33pm
#9
Unless you want to use this forum for a week or two and then delete it, you really, really, really don’t want to do that.
My guess is that you missed some tiny step somewhere that’s causing the problem, probably in the external Nginx config. You want to figure it out with the latest version.
Falco
(Falco)
June 27, 2019, 6:43pm
#10
A complete fresh install following Subfolder support with Docker is not working?
1 Like
john3
(Johnny)
June 27, 2019, 8:35pm
#11
Yes, it’s not working, that is why I am stuck at 404 errors, javascript files are not being loaded and giving 404 error as shown in the first post.
john3
(Johnny)
June 27, 2019, 8:36pm
#12
this is my external config for the Nginx reverse proxy.
location /community {
pagespeed off;
rewrite /(.*) /$1 break;
proxy_pass http://127.0.0.1:25654/;
proxy_read_timeout 90;
proxy_redirect http://127.0.0.1:25654/ https://www.domain.com/community;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
pfaffman
(Jay Pfaffman)
June 27, 2019, 9:07pm
#13
But the yml file you have above doesn’t look like the one in Subfolder support with Docker .
john3
(Johnny)
June 27, 2019, 9:20pm
#14
That’s because that config file didn’t work in the past, so the one I am using now was suggested by @neil here and it worked in the past. Currently, I also tried the config file uploaded there, but that didn’t work too.
Falco
(Falco)
June 27, 2019, 9:46pm
#15
john3:
Yes, it’s not working, that is why I am stuck at 404 errors, javascript files are not being loaded and giving 404 error as shown in the first post.
Well, I just bought a brand new droplet and set it up here: https://subfolder.muito.ninja/forum , following the Subfolder support with Docker
It is working fine for me.
So I’m afraid your reverse proxy is breaking it up…
1 Like
Hi @john3 , subfolder installation is painful
I compared my config (left) and yours (right), take a look at line 12, probably you forgot to change word forum
. Next, I have extra block replace
, lines 22-29:
The end:
External proxy:
location /discuss {
## This is ProxyPassReverse for Nginx
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600;
proxy_connect_timeout 240;
proxy_set_header Host $host;
proxy_set_header X-RealIP $remote_addr; #Important line for our logging objective
## End This is ProxyPassReverse for Nginx
proxy_pass http://192.168.1.2$request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2 Likes
john3
(Johnny)
June 28, 2019, 7:36pm
#17
Could you please share with me your reverse proxy config?
john3
(Johnny)
June 28, 2019, 7:49pm
#18
I have made the changes and it’s still the same. My configs are given below. I am using Centos 7 with overlay2 as device storage driver.
Nginx reverse proxy:
location /community {
pagespeed off;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600;
proxy_connect_timeout 240;
proxy_set_header Host $host;
proxy_set_header X-RealIP $remote_addr; #Important line for our logging objective
## End This is ProxyPassReverse for Nginx
proxy_pass http://127.0.0.1:25654$request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
app.yml
run:
- exec:
cd: $home
cmd:
- mkdir -p public/community
- cd public/community && ln -s ../uploads && ln -s ../backups
- replace:
global: true
filename: /etc/nginx/conf.d/discourse.conf
from: proxy_pass http://discourse;
to: |
rewrite ^/(.*)$ /community/$1 break;
proxy_pass http://discourse;
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: etag off;
to: |
etag off;
location /community/ {
rewrite ^/community/?(.*)$ /$1;
}
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: etag off;
to: |
etag off;
location /community {
rewrite ^/community/?(.*)$ /$1;
}
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: $proxy_add_x_forwarded_for
to: $http_fastly_client_ip
global: true
- exec: echo "End of custom commands"
Could you please send me the last part of your YML config i.e. -exec…
Falco
(Falco)
June 28, 2019, 7:49pm
#19
This depends on what software you are using to reverse proxy.
I’m using Caddy and following Running Discourse with Caddy Server
Only change from the guide is adding the folder in the Caddyfile:
subfolder.muito.ninja
proxy /forum unix:/sock/nginx.http.sock {
transparent
}
2 Likes
john3
(Johnny)
June 28, 2019, 8:00pm
#20
I see… I am using a digital ocean droplet with Centos 7 and overlay2 storage driver. Nginx as the web server and let’s encrypt’s SSL.
Here it is the full file.
en.app.yml.gz (2.1 KB)
UPD: that forum is working on 1.9.0, so I am not sure about latest, just in case…
1 Like
john3
(Johnny)
June 28, 2019, 8:37pm
#22
ahh, I see. well, I just regret updating it
john3
(Johnny)
June 28, 2019, 9:44pm
#23
@pfaffman @Falco @Ivan_Rapekas I have noticed one change during the installation process i.e. previously during the compression of assets I could see this process twice, once with /public/assets...
and then again with /public/community/assets...
and the installation took time as it compiled twice. Now, I don’t see this message and i get only something like below and then the installation is completed.
3729805.649853851 Compressing: application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js
uglifyjs '/var/www/discourse/public/assets/_application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js' -p relative -m -c -o '/var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js' --source-map-root '/assets' --source-map '/var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js.map' --source-map-url '/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js.map'
gzip -f -c -9 /var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js > /var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js.gz
brotli -f --quality=11 /var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js --output=/var/www/discourse/public/assets/application-177e5c04adfc0e63a82cc75f84460d3c59337339a5a12efa3bf1013e18f465f1.js.br
probably the below command does not work with the latest release or something.
- rm -fr public/assets
- sudo -E -u discourse bundle exec rake assets:precompile
but it does not work with or without these commands. However, this command did work for me previously.
1 Like
john3
(Johnny)
June 28, 2019, 11:14pm
#24
Alright, folks… after like several hours and days and lol… The issue was with the pagespeed configuration code i.e.
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 7d;
add_header Cache-Control "public, no-transform";
}
I had to rebuild again and again and delete a line by line code of Nginx configuration file and found this to be the main culprit for /community
folder. Rebuild, restore, boom!
Thank you @pfaffman @Falco @Ivan_Rapekas
4 Likes
pfaffman
(Jay Pfaffman)
June 28, 2019, 11:18pm
#25
Uh, Yeah. See also Install ngx_pagespeed - #2 by Falco .
Let’s hope not.
2 Likes
system
(system)
closed
July 28, 2019, 11:18pm
#26
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.