Confirmation link contains port

(Simevo) #1

the discourse instance is running on cloud_server_somewhere at port 3000 and proxied to at the standard http port 80

we have:

hostname = ""

is set in config/discourse.conf

account activation emails are sent with the link to confirm and activate the new account
the hostname is OK but it still has the port, as in:

whereas we’d like to have:

how can we achieve that ? thanks !

(Jeff Atwood) #2

Looks like you have set the developer only site setting to specify the port. This will cause problems on a production site.

(Simevo) #3

Thanks for the quick reply. The server is currently in development mode. I must confess that we followed the deprecated Discourse Ubuntu Install Guide !

Browsing the code it appears that the link is generated from this template:


So the presence of the 3000 port in the hostname must be a consequence of an incorrectly set base_url. Searching for base_url I find similar conversations like this one.

I’ll report back what happens when we switch to production, hopefully the problem will go away then. From this test its seems it could:

bin/rails c
Loading development environment (Rails 4.1.10)
[1] pry(main)> GlobalSetting.hostname
=> ""
[2] pry(main)> Discourse.current_hostname
=> ""
[3] pry(main)> RailsMultisite::ConnectionManagement.current_hostname
=> ""
[4] pry(main)> Discourse.base_url
=> ""

RAILS_ENV=production bin/rails c
Loading production environment (Rails 4.1.10)
irb(main):001:0> GlobalSetting.hostname
=> ""
irb(main):002:0> Discourse.current_hostname
=> ""
irb(main):003:0> RailsMultisite::ConnectionManagement.current_hostname
=> ""
irb(main):004:0> Discourse.base_url
=> ""

(eriko) #4

You will get much less support running bare metal as everything is designed for a docker based production environment. I ran bare metal for a close to two years as my instance predated the docker setup. It made doing updates a bit of a pain and pretty manual compared to the docker based update. Also if you are ever going to need to do multisite (one codebase many sites) It is much easier in docker to do all the updates at once.