Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
upstream django {
    server unix:///home/ubuntu/web/; # for a file socket
server {
    listen      80;
    charset     utf-8;
    client_max_body_size 75M;   # adjust to taste

    #--------PHP PART -----------------------
    location /blog {
                alias /var/www;
                try_files $uri =404;
                index index.php index.html;

        location ~ /blog/.+\.php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;

        location ~ /\.ht {
                deny all;
    location /media  {
        alias /home/ubuntu/web/;

    location /static {
        alias /home/ubuntu/web/;

    location / {
        uwsgi_pass  django;
        include     /home/ubuntu/web/;

I have nginx<-->uwsgi<-->django working just fine. [django : working] [wordpress not working]

INFO : [followed this blog to setup wordpress part]

share|improve this question
What is the problem you are having? – Michael Hampton Jan 25 '14 at 15:46
i have no idea how to redirect to wordpress part using nginx settings. rightnow i am getting nginx 404 file not found – Sourabh Singh Jan 25 '14 at 15:48
Does it works if you type exactly ? – adrian7 Jan 25 '14 at 15:52 shows django site. but mysite/blog/index.php gives : File not Found.[not 404 nginx] – Sourabh Singh Jan 25 '14 at 15:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.