Created
January 26, 2016 12:14
-
-
Save deepredsky/0373740b4a7d3a455616 to your computer and use it in GitHub Desktop.
basic nginx reverse proxy for rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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