Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name new2.fenshui.center;
- root /home/fenshc_u/www/new2.fenshui.center;
- set $pool_name new2.fenshui.center;
- access_log /home/fenshc_u/www/logs/nginx.new2.fenshui.center.access.log main;
- error_log /home/fenshc_u/www/logs/nginx.new2.fenshui.center.error.log;
- client_max_body_size 100m;
- location / {
- index index.php;
- try_files $uri $uri/ @wordpress;
- }
- location @wordpress {
- rewrite "^/(.*)$" "/index.php?q=$1" last;
- }
- location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
- }
- location ~* ^.+.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
- access_log off; log_not_found off; expires max;
- }
- location ~ \.php$ {
- fastcgi_pass unix:/run/php/php7.0-fpm.$pool_name.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~* "^/(wp-config.php)((/.*)?)$" {
- deny all;
- return 404;
- }
- location ~* /((wp-config|plugin_upload|xmlrpc).php|(readme|license|changelog).(html|txt|md)|(debug|access|error)(.|_)log)$ {
- return 444;
- }
- location ~* /.*((wp-config|xmlrpc).*(php(_bak|~|#)|txt|old|bak|save|orig(|inal)|swp|swo)).*$ {
- return 444;
- }
- if ($query_string ~* "^(.*)(wp-config.php|dl-skin.php|xmlrpc.php|uploadify.php|admin-ajax.php|local.xml)(.*)$") {
- return 444;
- }
- if ($request_uri ~* "^(.*)(wp-config.php|xmlrpc.php)(.*)$") {
- return 444;
- }
- if ($query_string ~* "(concat.*\(|union.*select.*\(|union.*all.*select)") {
- return 444;
- }
- if ($request_uri ~* "(concat.*\(|union.*select.*\(|union.*all.*select)") {
- return 444;
- }
- if ($query_string ~* "author=[0-9]") {return 301 $scheme://$host/;}
- if ($request_uri ~* "author=[0-9]") {return 301 $scheme://$host/;}
- location ~* /(?:uploads|files)/.*\.(php|cgi|py|pl)$ {return 444;}
- location ~* /(wp|page)/.*wp-.*/.*$ {return 444;}
- location = /wp-includes/css/buttons-rtl.css {
- if ($http_referer !~* "/wp-admin") {return 404;}
- }
- location = /wp-includes/js/tinymce/wp-tinymce.js.gz {
- if ($http_referer !~* "/wp-admin") {return 404;}
- }
- #location = /robots.txt {if ($http_referer != "") {return 404;}}
- location = /wp-content/ {return 404;}
- location = /wp-includes/ {return 404;}
- location = /wp-content/plugins/ {return 404;}
- location = /wp-content/uploads/ {return 404;}
- location = /wp-content/themes/ {return 404;}
- location = /wp-content/languages/ {return 404;}
- location = /wp-content/languages/plugins/ {return 404;}
- location = /wp-content/languages/themes/ {return 404;}
- location ~* /wp-content/plugins/([0-9a-z\-_]+)(/|$) {return 404;}
- location ~ /wp-content/languages/(.+)\.(po|mo)$ {return 404;}
- if ($http_user_agent ~* (nmap|nikto|wikto|sf|sqlmap|bsqlbf|w3af|acunetix|havij|appscan|nic.ru|monitoring|virusdie|indy|python|wpscan)) {return 403;} #semalt|php|perl
- #if ($http_user_agent ~ ^(|-|_)$) {return 403;}
- location = /nginx.conf { deny all; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement