You will need to disable this function discourse/lib/middleware/enforce_hostname.rb at main · discourse/discourse · GitHub
Plugin code would be
after_initialize do
module ::OverrideEnforceHostname
def call(env)
@app.call(env)
end
end
class Middleware::EnforceHostname
prepend OverrideEnforceHostname
end
end