ruby on rails - Running two applications on a VPS using nginx passenger -
i'm hosing rails application on digital ocean. working perfectly. host sinatra application on same vps. have setup nameservers , dns.
my opt/nginx/conf/nginx.conf
is:
worker_processes 1; events { worker_connections 1024; } http { passenger_root /home/deploy/.rvm/gems/ruby-2.0.0-p0/gems/passenger-4.0.0.rc6; passenger_ruby /home/deploy/.rvm/wrappers/ruby-2.0.0-p0/ruby; include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name domain1.com; charset utf-8; root /home/deploy/apps/domain1/current/public; passenger_enabled on; rails_spawn_method smart; rails_env production; } server { listen 80; server_name domain2.com www.domain2.com; charset utf-8; root /home/deploy/apps/domain2-path/public; passenger_enabled on; rails_spawn_method smart; } }
now when go domain2.com loads application of domain1.com, doing wrong.
ps: domain1.com rails applicion , domain2.com sinatra application.
you cannot defining dns address. should run other app on different url.
then this:
upstream rails { server 127.0.0.1:8000; } upstream sinatra { server 127.0.0.1:7000; } server { location /rails { proxy_pass http://rails; } location /sinatra { proxy_pass http://sinatra; } }
Comments
Post a Comment