Skip to content

Instantly share code, notes, and snippets.

@OlofFredriksson
Created April 21, 2015 13:28
Show Gist options
  • Save OlofFredriksson/c3755ff9250ac722e6c3 to your computer and use it in GitHub Desktop.
Save OlofFredriksson/c3755ff9250ac722e6c3 to your computer and use it in GitHub Desktop.
Simple Nginx conf for Django
upstream localhost {
server localhost:8000;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
server_name localhost;
location / {
proxy_pass http://localhost;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /static {
root /opt/static;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment