I'm trying to redirect all 404 pages to a custom handler with NGINX. I spent few hours to made the following rewrite in nginx but my question is: can it be a security breach?

location ~ ^/(?!(dbadmin)) { 
    if (!-f $request_filename) {
        rewrite ^/([^?]*)$ /index.php?_type_=handler&_route_=redirect&path=$1 break;
  • Why would you think this is unsafe? – John Conde Jun 23 '18 at 19:16
  • Hours on that? save yourself time and do it properly. Host the dbAdmin on a different domain or a sub-domain on a different port other than 80, 8080 or 443, or use an htaccess that blocks all IP addresses except yours. – Simon Hayter Jun 23 '18 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.