Class: Nginx::Builder::RailsHttps

Inherits:
Rails show all
Includes:
Https
Defined in:
lib/shared_infrastructure/nginx/builder.rb

Instance Attribute Summary collapse

Attributes inherited from Rails

#rails_env

Attributes inherited from Base

#domain, #server_blocks

Instance Method Summary collapse

Methods included from Https

#save

Methods inherited from Rails

#save

Methods inherited from Site

#save, #user

Methods inherited from Base

#https_reminder_message, #save, #to_s

Constructor Details

#initialize(user, certificate_domain = nil, accel_location: nil, domain: nil, rails_env: "production") ⇒ RailsHttps

Returns a new instance of RailsHttps.



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/shared_infrastructure/nginx/builder.rb', line 222

def initialize(user, certificate_domain = nil, accel_location: nil, domain: nil, rails_env: "production")
  @certificate_domain = certificate_domain || domain.domain_name
  accel_location = Accel.new(accel_location, domain) if accel_location
  super(user,
    Nginx::ServerBlock.new(
      upstream: Nginx::Upstream.new(domain.domain_name),
      server: Nginx::RailsServer.new(domain: domain),
      listen: Nginx::ListenHttps.new(domain.domain_name, certificate_domain),
      location: [
        Nginx::RailsLocation.new(domain.domain_name),
        accel_location ? Nginx::AccelLocation.new(domain.domain_name, accel_location) : nil,
        Nginx::ActionCableLocation.new(domain.domain_name)
      ].compact,
      accel_location: accel_location,
      domain: domain
    ),
    Nginx::TlsRedirectServerBlock.new(domain.domain_names),
    domain: domain,
    rails_env: rails_env
  )
end

Instance Attribute Details

#certificate_domainObject (readonly)

Returns the value of attribute certificate_domain.



244
245
246
# File 'lib/shared_infrastructure/nginx/builder.rb', line 244

def certificate_domain
  @certificate_domain
end