Is it possible to use Nginx on my personal VPS to act as a reverse proxy in front of Heroku (running a Ruby on Rails app)?
I'd like to do this because I want to route standard requests (i.e.
GET http://mydomain.com) to my Rails app, but various subdomain requests (i.e.
GET http://joe.mydomain.com) to a separate server.
As a bit of a part 2 (assuming this is possible), what are the correct Nginx proxy headers to set in this case? I usually do the following when using Nginx in front of Unicorn:
proxy_redirect off; proxy_read_timeout 5m; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto http;
As it is in nearly every single tutorial, but I'm not knowledgable enough to know which apply (or are missing) in this case.
Help would be greatly appreciated!