title: Nginx: running wordpress in subfolder of a Symfony2 app
body: <p>I run a Symfony2 app with nginx and want to integrate a wordpress installation in a subfolder of the public web-folder.</p>
  
  <p>Example:</p>
  
  <pre><code>http://www.example.com          -&gt; Symfony 2
  http://www.example.com/magazin  -&gt; Wordpress
  </code></pre>
  
  <p>With the origin nginx configuration of the Symfony app i can sucessfully make requests to the start-page of wordpress and also the whole admin-area including plugin installation and so on.</p>
  
  <p>But since i configured wordpress to use a custom url scheme "year/month/title" for the posts, the request ends up in a 404. I figured out, that not wordpress is the application who gets the request, but symfony, which certainly doesnt know what to do here. The URL that wordpress creates for a post, is correct (e.g. <a href="http://www.example.com/magazin/2015/12/my-interesing-post" rel="nofollow">http://www.example.com/magazin/2015/12/my-interesing-post</a>).</p>
  
  <p>Is it possible, to extend the nginx configuration in a way to handle all requests below the specific folder "/magazin/" and if so, how?</p>
  
  <p>This is my nginx configuration, which currently handles only the Symfony2 application:</p>
  
  <pre><code>server {
    listen *:80;
    server_name           www.example.de;
  
  
    index  app.php index.php index.html;
  
    access_log            /var/log/nginx/www.example.de.access.log combined;
    error_log             /var/log/nginx/www.example.de.error.log;
  
    location ~ \.php$ {
  
      root          /data/www/www.example.de/current/web;
      include       /etc/nginx/fastcgi_params;
      try_files     $uri $uri/ /app.php?$query_string;
  
      fastcgi_pass  unix:/var/run/php5-fpm.sock;
      fastcgi_index app_prod.php;
      fastcgi_param X_FORWARD_PORT "80";
      fastcgi_param CUSTOMER_ENV customer_default;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      include fastcgi_params;
    }
  
    location / {
  
      root      /data/www/www.example.de/current/web;
      index     app.php index.php index.html;
      try_files $uri $uri/ /app.php?$query_string;
    }
  }
  </code></pre>