Class: Nginx::ServerBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/shared_infrastructure/nginx/server_block.rb

Direct Known Subclasses

TlsRedirectServerBlock

Instance Method Summary collapse

Constructor Details

#initialize(upstream: nil, server: nil, listen: nil, location: nil, accel_location: nil, domain: nil) ⇒ ServerBlock

Returns a new instance of ServerBlock.



7
8
9
10
11
12
13
14
# File 'lib/shared_infrastructure/nginx/server_block.rb', line 7

def initialize(upstream: nil, server: nil, listen: nil, location: nil, accel_location: nil, domain: nil)
  @accel_location = accel_location
  @domain = domain
  @listen = listen
  @location = Array(location)
  @server = server
  @upstream = upstream
end

Instance Method Details

#to_sObject



16
17
18
19
20
21
# File 'lib/shared_infrastructure/nginx/server_block.rb', line 16

def to_s
  [
    upstream_string,
    server_block_string
  ].compact.join("\n\n")
end