Ask about a filtering rule for nginx
大家讲道理
大家讲道理 2017-05-16 17:21:23
0
2
603

Need to filter out some illegal characters in the server url:

For example | ; $ @ ' " < > ( ) document LF

Because all locations are required, they are written under the server:

if ($request_uri ~* "##这里怎么写##"){
    return 403;
}

I am a novice, please give me some guidance. . . .

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
PHPzhong

It is recommended to write the single-character blacklist and multi-character blacklist in two sections
Single-character blacklist:

if ( $request_uri ~ [|;$@'"<>()] ) {
    return 403;
    }

Multiple characters:

if ( $request_uri ~ (document|LF) {
    return 403;
    }
迷茫

The question should be written more clearly

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!