Re: Monstra без Apache (на Nginx)
Вижу никто не использует, только Nginx на серверах.
Все ставят динозавра Apache или связку
Re: Monstra без Apache (на Nginx)
просто этот ответ уже был ещё на заре появления монстры.
мой рабочий конфиг
server {
listen *:80;
server_name site.ru;
if ($request_method !~ ^(GET|HEAD|POST)$ ){ return 444; }
deny 213.186.127.14; #AhrefsBot/3.1; +http://ahrefs.com/robot/
if ($http_referer ~* "semalt\.com") {
return 403;
}
if ($http_user_agent ~ "AhrefsBot") {
return 403;
}
if ($http_user_agent ~ "MJ12bot") {
return 403;
}
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) ) {
return 403;
}
## Блокировка 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;
}
if ($query_string ~ "concat.*\(") {
set $block_sql_injections 1;
}
if ($block_sql_injections = 1) {
return 403;
}
## Блокировка file-injections
set $block_file_injections 0;
if ($query_string ~ "[a-zA-Z0-9_]=http://") {
set $block_file_injections 1;
}
if ($query_string ~ "[a-zA-Z0-9_]=(\.\.//?)+") {
set $block_file_injections 1;
}
if ($query_string ~ "[a-zA-Z0-9_]=/([a-z0-9_.]//?)+") {
set $block_file_injections 1;
}
if ($block_file_injections = 1) {
return 403;
}
## Блокировка common-exploits
set $block_common_exploits 0;
if ($query_string ~ "(|%3E)") {
set $block_common_exploits 1;
}
if ($query_string ~ "GLOBALS(=|\[|\%[0-9A-Z]{0,2})") {
set $block_common_exploits 1;
}
if ($query_string ~ "_REQUEST(=|\[|\%[0-9A-Z]{0,2})") {
set $block_common_exploits 1;
}
if ($query_string ~ "proc/self/environ") {
set $block_common_exploits 1;
}
if ($query_string ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3D)") {
set $block_common_exploits 1;
}
if ($query_string ~ "base64_(en|de)code\(.*\)") {
set $block_common_exploits 1;
}
if ($block_common_exploits = 1) {
return 403;
}
## Блокировка спама
set $block_spam 0;
if ($query_string ~ "\b(ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo)\b") {
set $block_spam 1;
}
if ($query_string ~ "\b(erections|hoodia|huronriveracres|impotence|levitra|libido)\b") {
set $block_spam 1;
}
if ($query_string ~ "\b(ambien|blue\spill|cialis|cocaine|ejaculation|erectile)\b") {
set $block_spam 1;
}
if ($query_string ~ "\b(lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby)\b") {
set $block_spam 1;
}
if ($block_spam = 1) {
return 403;
}
location / {
root /www/site;
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php last;
}
}
location /admin {
root /www/site;
auth_basic "Closed site";
auth_basic_user_file /usr/local/nginx/conf/site.htpasswd;
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php last;
}
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root /www/site;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/site$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}Страдание фигнёй на рабочем месте развивает боковое зрение, слух, скорость реакции и бдительность в целом.
Пишу плагины под заказ, конвертирую шаблоны под Монстра - пишите на email через ссылку в профиле.
Пишу плагины под заказ, конвертирую шаблоны под Монстра - пишите на email через ссылку в профиле.

