Welcome! Log In Create A New Profile

Advanced

Specific string = return 404

Posted by nexon 
Specific string = return 404
February 10, 2015 07:37AM
How to when there is a "@" string in the path of the URL - 404 should be returned?

Example:

http://example.com/aa@aa.com/ - should return 404
http://example.com/img/ - should work as usual

Thanks in advance...
Re: Specific string = return 404
February 10, 2015 08:39AM
Use map;

map $request_uri $requri {
default 0;
~\@ 1;
}
...................
server {
if ($requri) { return 404; }
}

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready