Last active
December 15, 2015 17:29
-
-
Save Problematic/5296900 to your computer and use it in GitHub Desktop.
simple nginx conf for django under foreman
This file contains hidden or 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
| #user nobody; | |
| worker_processes 1; | |
| pid /tmp/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| keepalive_timeout 65; | |
| upstream app_server { | |
| # server unix:/tmp/gunicorn.sock fail_timeout=0; | |
| # For a TCP configuration: | |
| server localhost:5000 fail_timeout=0; | |
| } | |
| server { | |
| listen 5050; | |
| server_name localhost; | |
| root /<path-to-django-project>; # changeme! | |
| location / { | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_redirect off; | |
| if (!-f $request_filename) { | |
| proxy_pass http://app_server; | |
| break; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment