Skip to content

Instantly share code, notes, and snippets.

@alexander-ae
Created February 5, 2015 15:08
Show Gist options
  • Save alexander-ae/f702fe052626fa87cfc4 to your computer and use it in GitHub Desktop.
Save alexander-ae/f702fe052626fa87cfc4 to your computer and use it in GitHub Desktop.
nginx: django + wordpress
server {
listen 80;
# server_name base.pe;
server_tokens off;
root /home/devstaff/webapps/;
location /blog {
index index.php index.html index.htm;
try_files $uri $uri/ /blog/index.php?q=$uri&$args;
}
location ~ .+\.php$ {
include /home/devstaff/opt/nginx/conf/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location /static_web {
alias /home/devstaff/webapps/static_web/ ;
expires 7d;
}
location /media_web {
alias /home/devstaff/webapps/media_web/ ;
}
location = /favicon.ico {
rewrite "/favicon.ico" "/static_web/img/favicon/favicon-256.png";
expires 7d;
}
location / {
include uwsgi_params;
uwsgi_pass unix:///home/devstaff/tmp/uwsgi.sock;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment