I am writing some PHP CMS code with a clean url implementation in Nginx. To improve security of my code I want to rewrite all of the requests in my root directory /
using the following type:
rewrite ^(.*)$ /index.php?q=$1 last;
With this kind of rewrite the rest of the php scripts will not be accessible from the user's side (they will be only, if included in php, am I right?). However, I do not want to rewrite the request in one location (for mi that will me /static/
), because I will be serving only static content such as images and css from that location. How can I make this rewrite not work in certain locations?