Class: Nginx::Builder::ReverseProxyHttps

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

Instance Attribute Summary collapse

Attributes inherited from Base

#domain, #server_blocks

Instance Method Summary collapse

Methods included from Https

#save

Methods inherited from Base

#https_reminder_message, #save, #to_s

Constructor Details

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

Returns a new instance of ReverseProxyHttps.



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/shared_infrastructure/nginx/builder.rb', line 85

def initialize(proxy_url, certificate_domain = nil, domain: nil)
  @certificate_domain = certificate_domain || domain.domain_name

  super(Nginx::ServerBlock.new(
    server: Nginx::Server.new(domain: domain),
    listen: Nginx::ListenHttps.new(domain.domain_name, certificate_domain),
    location: Nginx::ReverseProxyLocation.new(proxy_url)
  ),
    Nginx::TlsRedirectServerBlock.new(domain.domain_name),
    domain: domain
  )
end

Instance Attribute Details

#certificate_domainObject (readonly)

Returns the value of attribute certificate_domain.



98
99
100
# File 'lib/shared_infrastructure/nginx/builder.rb', line 98

def certificate_domain
  @certificate_domain
end