Skip to content

Instantly share code, notes, and snippets.

@deepredsky
Created January 26, 2016 12:14
Show Gist options
  • Save deepredsky/0373740b4a7d3a455616 to your computer and use it in GitHub Desktop.
Save deepredsky/0373740b4a7d3a455616 to your computer and use it in GitHub Desktop.
basic nginx reverse proxy for rails
upstream my_app {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name _;
# An alias to your upstream app
location @my_app {
proxy_read_timeout 60s;
}
# Set your doc root for static files
root /var/www/my_app/public;
# See if the request matches a static file. If not, pass it on to your app.
try_files $uri @my_app;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment