I had the opposite problem to that of the original poster when setting up a dev site yesterday: I’m running my dev server behind a Nginx proxy so I want clean URL’s, but no matter what I changed in my settings, Discourse kept adding :3000 to many of my internal links including the site logo. I eventually tracked this down to lines 291 - 293 in lib/discourse.rb:
if Rails.env.development? && SiteSetting.port.blank?
url << ":#{ENV["UNICORN_PORT"] || 3000}"
end
Commenting out these lines made my logo and other links work correctly, although I don’t know if this can lead to other things breaking down the road. It does seem a bit counter-intuitive to override SiteSetting.port in this manner.