ruby - Sinatra, Unicorn and Nginx - Proxy multiple Sinatra Apps -


i have multiple sinatra apps on unicorn + nginx , want proxy second sinatra app on /app path.

root root/app 

here nginx configuration file:

upstream root {     # path unicorn sock file, defined     server unix:/tmp/unicorn.root.com.sock fail_timeout=0; }  upstream app {     # path unicorn sock file, defined     server unix:/tmp/unicorn.app.io.sock fail_timeout=0; }   server {     listen 80;      # set server name, similar apache's settings     server_name root.com www.root.com;     # 301 redirect http://root.com$requesturi;      # application root, defined     root /var/www/root.com/public;      try_files $uri/index.html $uri @root;      location @root {         proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;         proxy_set_header host $http_host;         proxy_redirect off;         proxy_pass http://root;     }      location /app {         proxy_set_header   x-real-ip $remote_addr;         proxy_set_header   host      $http_host;         proxy_pass http://app;     }       error_page 500 502 503 504 /500.html;     client_max_body_size 4g;     keepalive_timeout 10;      access_log  off; } 

using configuration above 404 app application.

how can achieve that?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -