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, #server_blocks

Instance Method Summary collapse

Methods inherited from Base

#https_reminder_message, #to_s

Constructor Details

#initialize(proxy_url, certificate_domain = nil, domain: nil) ⇒ ReverseProxyHttp

Returns a new instance of ReverseProxyHttp.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/shared_infrastructure/nginx/builder.rb', line 61

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

Instance Method Details

#saveObject



76
77
78
79
80
# File 'lib/shared_infrastructure/nginx/builder.rb', line 76

def save
  result = super
  https_reminder_message
  result
end