AWSに複数のRailsアプリをデプロイしたいと考えています。
今一つのアプリがすでに`http:domain.com:80/'で動いています。
これを今APIで使っているのでこのドメインは動かしたくありません。
そこで`http:domain.com:81/'で別のapplicationにアクセスできるようにしたいのですが、どのようにすればいいのでしょうか?
現在、nginxの設定は
/etc/nginx/conf.d/app1.conf
が
error_log /var/www/app1/current/log/nginx.error.log; access_log /var/www/app1/current/log/nginx.access.log; client_max_body_size 2G; upstream app1 { server unix:/var/www/app1/current/tmp/sockets/.unicorn.sock fail_timeout=0; } server { listen 80; server_name 52.34.83.184; keepalive_timeout 1; root /var/www/app1/current/public; try_files $uri/index.html $uri.html $uri @app; location @app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app1; } error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/app1/current/public; } }
/etc/nginx/conf.d/app2.conf
が
error_log /var/www/app2/current/log/nginx.error.log; access_log /var/www/app2/current/log/nginx.access.log; upstream app2 { server unix:/var/www/app2/current/tmp/sockets/.unicorn.sock fail_timeout=0; } server { listen 81; server_name 52.34.83.184; keepalive_timeout 1; root /var/www/app2/current/public; try_files $uri/index.html $uri.html $uri @app; location @app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass https://app2; } error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/app2/current/public; } }
解決法わかる方お願いいたします。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/14 09:44