Class: Nginx::Builder::ReverseProxyHttp

Inherits:
Base
  • Object
show all
Defined in:
lib/shared_infrastructure/nginx/builder.rb

Instance Attribute Summary

Attributes inherited from Base

#domain_name, #server_blocks

Instance Method Summary collapse

Methods inherited from Base

#https_reminder_message, #to_s

Constructor Details

#initialize(domain_name, proxy_url, certificate_domain = nil) ⇒ ReverseProxyHttp

Returns a new instance of ReverseProxyHttp.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/shared_infrastructure/nginx/builder.rb', line 56

def initialize(domain_name, proxy_url, certificate_domain = nil)
  super(domain_name,
    Nginx::ServerBlock.new(
      server: Nginx::Server.new(domain_name),
      listen: Nginx::ListenHttp.new,
      location: [
        # TODO: the following should really only happen when the domains
        # are different.
        Nginx::AcmeLocation.new(certificate_domain || domain_name),
        Nginx::ReverseProxyLocation.new(proxy_url)
      ]
    )
  )
end

Instance Method Details

#saveObject



71
72
73
74
75
# File 'lib/shared_infrastructure/nginx/builder.rb', line 71

def save
  result = super
  https_reminder_message
  result
end