Try to cleanse you question, especially the end of it shere you are shouting instead of providing code.
Based on the configuration you provided at the top of you question, I ended up with that:
location /forum/ { index dbseo.php; # You obviously wish to send everything erroneous/inexistent to dbseo.php, any index.php file would suffer the regex location below try_files $uri $uri/ /forum/dbseo.php?$args; # Any inexistent file/directory will be handled over to /forum/dbseo.php location ^~ /forum/dbseo.php { # Avoids matching the regex location below (performance) } location ^~ /forum/mobiquo { # Avoids matching any other rules } location ~* \.php$ { try_files /forum/dbseo.php =404; # Be careful here, try to secure your location since the regex can still be manipulated for arbitrary code execution } }
Nested locations are a good thing for isolation of potentially conflicting location blocks. Keep in mind that regex locations are evaluated seuqentially, thus to avoid the location blocks order having an impact (which is a mess just like Apache configuration), try to always enclose regex locations in prefix ones to avoid several of them following each other.
You can learn about location
modifiers on its documentation page.
Maybe are there more subtelties, but you have all the basic information you need in my example. THe job is yours to understand/improve it to better suit your needs. :o)