Skip to content

Instantly share code, notes, and snippets.

@fluffywaffles
Created February 24, 2016 21:10
Show Gist options
  • Save fluffywaffles/25761d5f9afb9e7f1c1d to your computer and use it in GitHub Desktop.
Save fluffywaffles/25761d5f9afb9e7f1c1d to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name _;
access_log /var/log/nginx/access.log;
# send requests matching ~ with .php extension to /usr/share/nginx/www
# handle with fastcgi
location ~ \.php$ {
root /usr/share/nginx/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# proxy all other requests to gunicorn at localhost:8000
location / {
proxy_pass http://localhost:8000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment