samson
samson copied to clipboard
nginx proxy_pass
i am not able to proxy_pass ~/deploy url to service running on port 3000 - First page loads but all successive urls are broken like /project/, /assets/ any suggestions ?
Currently using this in nginx conf
location ^~ /deploy {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
I haven't tested it, but you can try a url rewrite inside nginx or passing the environment variable RAILS_RELATIVE_URL_ROOT=/deploy:
http://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root
Rails logs would be helpful.
it loads assets after precompiling but some api calls like /active_count.json and /streaming still goes to without any relative url any leads on that ?