samson icon indicating copy to clipboard operation
samson copied to clipboard

nginx proxy_pass

Open vikas17a opened this issue 9 years ago • 2 comments

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;
}

vikas17a avatar Mar 07 '16 07:03 vikas17a

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.

steved avatar Mar 07 '16 17:03 steved

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 ?

vikas17a avatar May 07 '16 10:05 vikas17a