-
Notifications
You must be signed in to change notification settings - Fork 81
Configuration
This plugin works with minimal setup. However, configuration is possible.
In order to override the default, put the option in the stage file, example:
# in config/deploy/production.rb
set :unicorn_workers, 4
Defaults are listed near option name in the first line.
-
set :nginx_server_name
# defaults to<server_IP>
Your application's domain. The default is your server's IP address. -
set :nginx_pid, "/run/nginx.pid"
Path for nginx process pid file. -
set :nginx_location, "/etc/nginx"
Nginx installation directory.
SSL related options:
-
set :nginx_use_ssl, false
If set totrue
, nginx will be configured to 443 port and port 80 will be auto routed to 443. Also, onnginx:setup
, paths to ssl certificate and key will be configured. Certificate file and key will be uploaded to/etc/ssl/certs/
and/etc/ssl/private/
directories on the server. -
set :nginx_upload_local_cert, true
Iftrue
, certificates will be uploaded from a local path. Otherwise, it is expected for the certificate and key defined in the next 2 variables to be already on the server. -
set :nginx_ssl_cert, "#{fetch(:nginx_server_name)}.crt"
Remote file name of the certificate. Only makes sense ifnginx_use_ssl
is set. -
set :nginx_ssl_cert_key, "#{fetch(:nginx_server_name)}.key"
Remote file name of the certificate. Only makes sense ifnginx_use_ssl
is set. -
set :nginx_ssl_cert_local_path
# no default, required ifnginx_use_ssl = true
andnginx_upload_local_cert = true
Local path to file with certificate. Only makes sense ifnginx_use_ssl
is set. This file will be copied to remote server. Example value:set :nginx_ssl_cert_local_path, "/home/user/ssl/myssl.cert"
-
set :nginx_ssl_cert_key_local_path
# no default
Local path to file with certificate key. Only makes sense ifnginx_use_ssl
is set. This file will be copied to remote server. Example value:set :nginx_ssl_cert_key_local_path, "/home/user/ssl/myssl.key"
Defaults are listed near option name in the first line.
-
set :unicorn_service, "unicorn_#{fetch(:application)}_#{fetch(:stage)}
Unicorn service name isunicorn_myapp_production
by default. -
set :unicorn_pid, shared_path.join("tmp/pids/unicorn.pid")
Path for unicorn process pid file. -
set :unicorn_config, shared_path.join("config/unicorn.rb")
Path for unicorn config file. -
set :unicorn_workers, 2
Number of unicorn workers. -
set :unicorn_app_env
Set to the value ofrails_env
(for compatibility with capistrano-rails gem orstage
option. -
set :unicorn_use_tcp, -> { roles(:app).count > 1 }
-
true
if there are multipleapp
servers.nginx
andunicorn
communicate over tcp port. -
false
for single node configuration.nginx
andunicorn
communicate over unix socket.
-
-
set :unicorn_tcp_listen_port, 8080
Specifies tcp port whenunicorn_use_tcp
istrue
.