Rails複数サイトをサブディレクトリで動かす設定NginX側はこれでいいみたい。但しRailsでエラーが・・・・。 No route matches [GET] "/app1" ん? ------------------------------------------------------------------------------------------------------#myapp1 upstream myapp1 { server unix:/home/vagrant/railsapp/myapp1/tmp/sockets/unicorn.sock fail_timeout=0; }#myapp2 upstream myapp2 { server unix:/home/vagrant/railsapp/myapp2/tmp/sockets/unicorn.sock fail_timeout=0; } server { listen 80 default_server; server_name localhost; client_max_body_size 100m; error_page 404 /404.html; error_page 500 502 503 504 /500.html; location /app1 { root /home/vagrant/railsapp/myapp1; access_log /var/log/nginx/myapp1_access.log; error_log /var/log/nginx/myapp1_error.log; try_files $uri/index.html $uri @unicorn-app1; } location @unicorn-app1 { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://myapp1; } location /app2 { root /home/vagrant/railsapp/myapp2; access_log /var/log/nginx/myapp2_access.log; error_log /var/log/nginx/myapp2_error.log; try_files $uri/index.html $uri @unicorn-app2; } location @unicorn-app2 { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://myapp2; } }

Rails複数サイトをサブディレクトリで動かす設定NginX側はこれでいいみたい。但しRailsでエラーが・・・・。 No route matches [GET] "/app1" ん? ----...
=======================================
Rails複数サイトをサブディレクトリで動かす設定NginX側はこれでいいみたい。但しRailsでエラーが・・・・。

No route matches [GET] "/app1"

ん?

------------------------------------------------------------------------------------------------------
#myapp1
upstream myapp1 {
server unix:/home/vagrant/railsapp/myapp1/tmp/sockets/unicorn.sock fail_timeout=0;
}

#myapp2
upstream myapp2 {
server unix:/home/vagrant/railsapp/myapp2/tmp/sockets/unicorn.sock fail_timeout=0;
}

server {
listen 80 default_server;
server_name localhost;


client_max_body_size 100m;
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;


location /app1 {
root /home/vagrant/railsapp/myapp1;
access_log /var/log/nginx/myapp1_access.log;
error_log /var/log/nginx/myapp1_error.log;
try_files $uri/index.html $uri @unicorn-app1;
}

location @unicorn-app1 {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp1;
}

location /app2 {
root /home/vagrant/railsapp/myapp2;
access_log /var/log/nginx/myapp2_access.log;
error_log /var/log/nginx/myapp2_error.log;
try_files $uri/index.html $uri @unicorn-app2;
}

location @unicorn-app2 {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp2;
}
}

http://ift.tt/1abnmbU
May 24, 2016 at 04:50PM

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)