How to run django and wordpress on NGINX server using same domain?
<p>I have tried many ways but do not know how to  run <strong>Django on example.com</strong> and <strong>wordpress on example.com/blog</strong></p>

<p>The following running project directory structure for Django and Wordpress. </p>

<p><strong>Django app dir</strong>- /home/ubuntu/django</p>

<p><strong>Django app running successfully on</strong> - example.com:8000 </p>

<p><strong>Wordpress dir</strong> - /var/www/html/blog</p>

<p><strong>Wordpress running successfully on</strong> - example.com</p>

<p><strong>Nginx configuration</strong></p>

<pre><code>server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /var/www/html/blog;
    index index.php index.html index.htm;

    server_name example.com;

    location / {
            # try_files $uri $uri/ =404;
            try_files $uri $uri/ /index.php?q=$uri&amp;$args;
    }

    error_page 404 /404.html;

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
            root /usr/share/nginx/html;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }
}
</code></pre>

<p><strong>Note-</strong> Django app running by gunicorn, I know the subdomain may be the solution but I do not want that.</p>

<p>How to write nginx configuration for both Wordpress and Django to run <strong>Django app</strong> on example.com and <strong>Wordpress</strong> on example.com/blog ?</p>