title: Nginx prevents to load resources if they don't have defined "no access word" in url
body: <p>I'm using NGINX as a reverse-proxy (for Grafana). I'm trying to prevent users to access URL when there's no a word <code>access</code> in it.</p>
  <p>Config:</p>
  <pre><code>location /some-location/ {
      proxy_set_header Host $http_host;
      if ($uri !~ &quot;^(.*)/access/(.*)&quot;){
          return 403;
      }
      proxy_pass https://IP_ADDRESS:PORT;
  }
  </code></pre>
  <p>User should have an access:</p>
  <pre><code>https://example.com/some-location/access/article/45
  </code></pre>
  <p>User should not have an access:</p>
  <pre><code>https://example.com/some-location/article/45
  </code></pre>
  <p>The problem is that all resource like: js, css, images etc. returns 403 (forbidden) because they don't have a word <code>access</code> in URL, for example:</p>
  <pre><code>https://example.com/some-location/media/css/main.css
  </code></pre>
  <p>How to prevent this?</p>