Explicit set the hostname

This commit is contained in:
Dennis Günnewig 2015-05-07 09:21:11 +02:00
parent 588f42f1df
commit 9741c68d34
3 changed files with 11 additions and 1 deletions

View file

@ -112,12 +112,13 @@ module Middleman
config[:environment] = opts[:environment].to_sym if opts[:environment]
config[:port] = opts[:port] if opts[:port]
config[:host] = opts[:host].presence || Socket.gethostname.tr(' ', '+')
config[:https] = opts[:https] unless opts[:https].nil?
config[:ssl_certificate] = opts[:ssl_certificate] if opts[:ssl_certificate]
config[:ssl_private_key] = opts[:ssl_private_key] if opts[:ssl_private_key]
end
@host = Socket.gethostname.tr(' ', '+')
@host = @app.config[:host]
@port = @app.config[:port]
@https = @app.config[:https]
@ -182,6 +183,7 @@ module Middleman
http_opts = {
Port: port,
AccessLog: [],
ServerName: host,
DoNotReverseLookup: true
}