Skip to content

Commit

Permalink
Find an expression to secure the installation
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed May 4, 2021
1 parent 65c8b9c commit ba7720c
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions docker/nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,33 @@ server {
listen 80 default_server;
listen [::]:80 default_server;
server_tokens off;
autoindex off;

# https://alexanderallen.medium.com/forwarding-nginx-logs-to-docker-3bb6283a207
error_log stderr warn;
access_log /dev/stdout main;

root /home/www/phpMyAdmin;
client_max_body_size 512M;

location / {
autoindex on;
index index.php;
client_max_body_size 512M;
}

location /.nginx/status {
stub_status;
allow all;
}

location ~ ^/.phpfpm/(status|ping)$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}

location /robots.txt {
return 200 "User-agent: *\nDisallow: /\n";
location ~ ^/.phpfpm/(status|ping)$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}

location /.git {
deny all;
}

location /vendor {
deny all;
}
location ~ ^(?!(\/favicon\.ico|\/robots\.txt|\/index\.php|\/url\.php|\/show_config_errors\.php|\/js\/messages\.php|\/js\/dist|\/js\/vendor|\/doc\/html|\/setup|\/themes|\/)) {
deny all;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
Expand Down

0 comments on commit ba7720c

Please sign in to comment.