what I want to do is to return internal (404) when a specific JS file is being used.
For example:
I have this block of code:
location ~* /something.min.js?id=c34f7s-d87a9-rthg76s {
internal;
}
which is written in some_name.conf file. That file is being included in the conf.d folder in a specific .conf file.
So far everything works just fine, nxing -t validates the configuration. But when I open the specific url in a browser it still works, so nothing changed.
I am new to nginx, so I was really desperate and tried following options too:
^~ /something.min.js?id=c34f7s-d87a9-rthg76s
/something.min.js?id=c34f7s-d87a9-rthg76s
= /something.min.js?id=c34f7s-d87a9-rthg76s
~* /something.min.js?id=c34f7s-d87a9-rthg76s
but none of them seemed to be working. So is there any other way how I could return 404 and stop the particular js file from working?
The only thing that really worked was, when I had a path like this:
/js/something?something=som.Something.setSomething
and used:
location /js/ {
deny all;
}
but of course that stops everything inside /js, not the specific file I want.
Thank you for your help!