Skip to content

Instantly share code, notes, and snippets.

View lazyjerry's full-sized avatar

Lazy Jerry lazyjerry

View GitHub Profile
@lazyjerry
lazyjerry / Nginx 防護設定 nginx config
Last active August 6, 2020 15:56
設定防止注入、檔案防護的機制。放在 nginx 的 server block 中
## 放在 server 區塊中,也可以獨立一個檔案讀取
## ref: https://www.howtoforge.com/nginx-how-to-block-exploits-sql-injections-file-injections-spam-user-agents-etc
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
set $block_sql_injections 1;