title: Nginx with subdirectory
body: <p>I'm trying to get the following configuration to work inside a subdirectory /dev but I'm quite new to Nginx and can't seem to get it to work properly. </p>
  
  <p>If you look at the below configuration, you'll see subdirectories such as <strong><em>content</em></strong>, <strong><em>site</em></strong>, etc. All of those directories are inside another subdirectory <strong><em>/dev</em></strong>. For example: <strong><em>root/dev/content</em></strong>, <strong><em>root/dev/site</em></strong>, etc.</p>
  
  <p>Can anyone lend a hand so that I can access the /dev site properly?</p>
  
  <pre><code># block content
  location ~ ^/content/(.*).(txt|md|mdown)$ {
      rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
  }
  
  # block all files in the site folder from being accessed directly
  location ~ ^/site/(.*)$ {
      rewrite ^/site/(.*)$ /error redirect;
  }
  
  # block all files in the kirby folder
  location ~ ^/kirby/(.*)$ {
      rewrite ^/kirby/(.*)$ /error redirect;
  }
  
  # site links
  location / {
      try_files $uri $uri/ /index.php?$uri&amp;$args;
  }
  
  # panel links
  location /panel {
      try_files $uri $uri/ /panel/index.php?$uri&amp;$args;
  }
  
  # deny access to .htaccess files
  location ~ /\.ht {
      deny all;
  }
  </code></pre>