Class: Nginx::Builder::RailsHttp

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

Instance Attribute Summary

Attributes inherited from Rails

#rails_env

Attributes inherited from Base

#domain, #server_blocks

Instance Method Summary collapse

Methods inherited from Site

#user

Methods inherited from Base

#https_reminder_message, #to_s

Constructor Details

#initialize(user, _certificate_domain = nil, accel_location: nil, domain: nil, rails_env: "production") ⇒ RailsHttp

Returns a new instance of RailsHttp.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/shared_infrastructure/nginx/builder.rb', line 192

def initialize(user, _certificate_domain = nil, accel_location: nil, domain: nil, rails_env: "production")
  accel_location = Accel.new(accel_location, domain: domain) if accel_location
  super(user,
      Nginx::ServerBlock.new(
        upstream: Nginx::Upstream.new(domain.domain_name),
        server: Nginx::RailsServer.new(domain: domain),
        listen: Nginx::ListenHttp.new,
        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
      ),
      domain: domain,
      rails_env: rails_env
    )
end

Instance Method Details

#saveObject



212
213
214
215
216
# File 'lib/shared_infrastructure/nginx/builder.rb', line 212

def save
  result = super
  https_reminder_message
  result
end