Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In unicorn.rb:</p> <p>application 1:</p> <pre><code>root = "/var/www/application_1/current" working_directory root pid "#{root}/tmp/pids/unicorn-app1.pid" listen "/tmp/unicorn.app1.sock" </code></pre> <p>application 2:</p> <pre><code>root = "/var/www/application_2/current" working_directory root pid "#{root}/tmp/pids/unicorn-app2.pid" listen "/tmp/unicorn.app2.sock" </code></pre> <p>In nginx.conf:</p> <p>application 1:</p> <pre><code>upstream app1_server { server unix:/tmp/unicorn.app1.sock fail_timeout=0; } server { listen 80; server_name my_app_1.com www.my_app_1.com; root /var/www/app1/current/public; location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @app1_server; location @app1_server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app1_server; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; } </code></pre> <p>application 2:</p> <pre><code>upstream app2_server { # point to app2 sock server unix:/tmp/unicorn.app2.sock fail_timeout=0; } server { listen 80; server_name my_app_2.com www.my_app_2.com; root /var/www/app2/current/public; location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @app2_server; location @app2_server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app2_server; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload