8000 tweak nginx vhost conf by dominis · Pull Request #8 · dominis/mikado · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions ansible/roles/nginx/templates/wp.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ server {
root /usr/share/nginx/html;
}

location /xmlrpc.php {
deny all;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/{{ domain }}.sock;
fastcgi_index index.php;
Expand All @@ -48,6 +44,25 @@ server {
log_not_found off;
}

# security
location ~* /(?:uploads|files)/.*.php$ {
deny all;
}

location ~* .(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(.php)?|xtmpl)$|^(..*|Entries.*|Repository|Root|Tag|Template)$|.php_ {
return 444;
}

location ~* .(pl|cgi|py|sh|lua)$ {
return 444;
}

location ~ /(.|wp-config.php|wp-comments-post.php|readme.html|license.txt|xmlrpc.php) {
deny all;
}


# Status endponts
location ~ ^/(fpm-status|fpm-ping)$ {
access_log off;
allow 127.0.0.1;
Expand Down
0