Skip to content

Instantly share code, notes, and snippets.

@Problematic
Last active December 15, 2015 17:29
Show Gist options
  • Select an option

  • Save Problematic/5296900 to your computer and use it in GitHub Desktop.

Select an option

Save Problematic/5296900 to your computer and use it in GitHub Desktop.
simple nginx conf for django under foreman
#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