title: Nginx Block/Deny Access to multiple locations regex
body: <p>I am using Nginx as a reverse proxy for my Apache instillation and as a security feature it blocks access to phpmyadmin, webalizer etc for everyone except localhost but using nginx it makes Apache think it is localhost so it displays it publicly for everyone.</p>
  
  <pre><code>&lt;LocationMatch "^/(?i:(?:xampp|security|phpmyadmin|licenses|webalizer|server-status|server-info))"&gt;
      Order deny,allow
      Deny from all
      Allow from ::1 127.0.0.0/8 \
          fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
          fe80::/10 169.254.0.0/16
  
      ErrorDocument 403 /
  &lt;/LocationMatch&gt;
  </code></pre>
  
  <p>I need to turn the above rules pattern matching regex into the following.</p>
  
  <pre><code>location /phpmyadmin {
          proxy_pass         htt://127.0.0.1:8080/phpmyadmin;
          allow 127.0.0.1;
          deny all;
      }
  </code></pre>
  
  <p>Much appreciated for help from anyone who is familiar with regex in Nginx.</p>
  
  <p>The following method works but breaks normal site urls that would be search engine friendly such as domain.com/forums/server-info</p>
  
  <pre><code>location ~ /(xampp|security|phpmyadmin|licenses|webalizer|server-status|server-info) {
      deny  all;
  }
  </code></pre>