Class: NginxStage::PunConfigGenerator

Inherits:
Generator
  • Object
show all
Includes:
PunConfigView
Defined in:
lib/nginx_stage/generators/pun_config_generator.rb

Overview

This generator stages and generates the per-user NGINX environment.

Instance Method Summary collapse

Methods included from PunConfigView

#access_log_path, #app_configs, #error_log_path, #group, #mime_types_path, #passenger_nodejs, #passenger_python, #passenger_root, #passenger_ruby, #pid_path, #restart_confirmation, #sendfile_root, #sendfile_uri, #socket_path, #tmp_root

Methods inherited from Generator

_options, add_hook, add_option, #create_file, desc, #empty_directory, footer, hooks, #initialize, #invoke, options, rem_hook, rem_option, #template

Methods included from GeneratorHelpers

#add_skip_nginx_support, #add_sub_uri_support, #add_user_support

Constructor Details

This class inherits a constructor from NginxStage::Generator

Instance Method Details

#app_init_urlString

The app initialization URL the user is redirected to if can’t find the app in the per-user NGINX config



39
40
41
42
43
44
45
46
47
48
# File 'lib/nginx_stage/generators/pun_config_generator.rb', line 39

add_option :app_init_url do
  {
    opt_args: ["-a", "--app-init-url=APP_INIT_URL", "# The user is redirected to the APP_INIT_URL if app doesn't exist"],
    default: nil,
    before_init: -> (uri) do
      raise InvalidAppInitUri, "invalid app-init-url syntax: #{uri}" if uri =~ /[^-\w\/?$=&.:]/
      uri
    end
  }
end