Class: Nginx::Builder::SiteHttps

Inherits:
Site
  • 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 Site

#save, #user

Methods inherited from Base

#https_reminder_message, #save, #to_s

Constructor Details

#initialize(user, certificate_domain = nil, domain: nil) ⇒ SiteHttps

Returns a new instance of SiteHttps.



148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/shared_infrastructure/nginx/builder.rb', line 148

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

  super(user,
    Nginx::ServerBlock.new(
      server: Nginx::StaticServer.new(domain: domain),
      listen: Nginx::ListenHttps.new(domain.domain_name, certificate_domain),
      location: Nginx::Location.new
    ),
    Nginx::TlsRedirectServerBlock.new(domain.domain_names),
    domain: domain
  )
end

Instance Attribute Details

#certificate_domainObject (readonly)

Returns the value of attribute certificate_domain.



162
163
164
# File 'lib/shared_infrastructure/nginx/builder.rb', line 162

def certificate_domain
  @certificate_domain
end