Redirect to on Login

(T. H. Wright) #1

When users log in to my Discourse installation, they are being redirected to a literal “”. The site’s source shows the following.

Personal Site Source
  @font-face {
    font-family: 'FontAwesome';
    src: url('/assets/fontawesome-webfont-ff82aeed6b9bb6701696c84d1b223d2e682eb78c89117a438ce6cfea8c498995.woff2?;2&v=4.5.0') format('woff2'),
         url('/assets/fontawesome-webfont-c812ddc9e475d3e65d68a6b3b589ce598a2a5babb7afc55477d59215c4a38a40.woff?;2&v=4.5.0') format('woff');

I notice that’s reads as follows.

Meta Discourse Site Source
  @font-face {
    font-family: 'FontAwesome';
    src: url(';2&v=4.5.0') format('woff2'),
         url(';2&v=4.5.0') format('woff');

At first I thought I was looking at a security breach, but my guess would be a setting isn’t properly set somewhere. My site loads on the domain it is supposed to and the docker container reports as follows for its hostname.

root@host-app:/# cat /etc/hostname

Looking over the admin’s backend I am not seeing a setting referencing Production logs are showing redirects for the logins to the site. Is there a setting that is perhaps missing in my app.yml or something I’m not seeing in the backend?

I adjusted the variable, which I found located in the following and the site now reports the proper value in the page’s source, but the redirect still occurs.


This seems to be the host_with_port variable in the software and for some reason it isn’t set. Is there a way I could push this to the container or add a value to the app.yml? Rebuilding the container caused no change. I am running Discourse 1.7.3 +1 on CentOS 7.3.

I adjusted the app.yml as well in order to report the correct hostname, but no change.

root@forums:/var/www/discourse# hostname

Edit 2: Here is a sample production.log entry.

Started POST "/login" for at 2017-02-21 20:19:58 +0000
Processing by StaticController#enter as HTML
  Parameters: {"username"=>"username", "password"=>"[FILTERED]", "redirect"=>"https://forums.domain.tld/"}
Redirected to
Completed 302 Found in 5ms (ActiveRecord: 1.6ms)
Started GET "/" for at 2017-02-21 20:20:01 +0000

(T. H. Wright) #3

Resolved this. There was a setting in the server’s web server configuration which was passing an x-forwarded-host; this variable had not been altered from the placeholder value of