Discourse URL tracking prevents proper redirects

(Sam Nazarko) #1


I have recently migrated a Discourse install by making a backup and then restoring it. It seems now that URL redirection is broken.

See Changing Webserver to Port 80 - Raspberry Pi - OSMC Forums. There I post a GitHub commit. Clicking on it seems to try and redirect me to the domain that is hosting the forum.



(Jens Maier) #2

Blind guess: did you try rake posts:rebake ?

(Sam Nazarko) #3
root@discourse-app:/# rake posts:rebake
Rebaking post markdown for 'default'
     1937 / 1937 (100.0%)
1937 posts done!

It ran, but doesn’t seem to have helped

(Mark Theis Madsen) #4

Discourse is treating external urls as internal. So when I click on a link it strips the domain and goes to Discourse Meta in ajax instead of http://externalsite.com/someurl.

(Jeff Atwood) #5

Looks like you have bad site settings somewhere, or perhaps app.yml has the domain name specified incorrectly.

(Mark Theis Madsen) #6

I have checked through the site settings, the app.yml and the other yml templates. Everything seems fine.

And I just noticed that internal urls opens like external urls should. without an ajax request.

(Sam Nazarko) #7

You may remember I posted here about having issues using the Pound load balancer. This has been the course of the problem yet again.

I set up a dedicated box for Discourse and used the Ubuntu 14.04 (trusty) version of Pound installed via apt-get. I did this as I was no longer using SNI (dedicated IPV4 for the service) and thus no longer needed bleeding edge (Pound SNI and SAN matching / Filidor Wiese <fili@fili.nl>)

I noticed that going through HTTP only with an /etc/hosts change was fine, indicating it is the load balancer.

As only recent versions of Pound have “Certificate alternate names support”, I believe that Pound was setting the wrong request URL. I confirmed this with some logging in the Varnish VCL. This was causing the issue