class Nginx::RailsServer

Public Instance Methods

root_directory() click to toggle source
# File lib/shared_infrastructure/nginx/server.rb, line 35
def root_directory
  File.join(domain.site_root, "public")
end
to_s(level = 0) click to toggle source
Calls superclass method Nginx::Server#to_s
# File lib/shared_infrastructure/nginx/server.rb, line 39
def to_s(level = 0)
  [
    super(level),
    Lines.new(
      "# http://stackoverflow.com/a/11313241/3109926 said the following",
      "# is what serves from public directly without hitting Puma",
      "root #{root_directory};",
      "try_files $uri/index.html $uri @#{domain.domain_name};",
      "error_page 500 502 503 504 /500.html;",
      "client_max_body_size 4G;",
      "keepalive_timeout 10;"
    ).format(level)
  ].join("\n\n")
end