Skip to content

Commit

Permalink
Update server-locations.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-inamdar committed Apr 3, 2020
1 parent 23f8ab9 commit 50c40c5
Showing 1 changed file with 27 additions and 35 deletions.
62 changes: 27 additions & 35 deletions .bp-config/nginx/server-locations.conf
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
# Charset
charset utf-8;

# PHP-FPM monitoring
location ~ ^/_php-fpm/(status|ping)$ {
access_log off;
log_not_found off;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php_fpm;
}
# favicon.ico and robots.txt
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }

# Some basic cache-control for static files to be sent to the browser
location ~* \.(?:ico|css|js|gif|jpeg|jpg|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
# PHP-FPM monitoring
location ~ ^/_php-fpm/(status|ping)$ {
access_log off;
log_not_found off;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php_fpm;
}

# Deny hidden files (.htaccess, .htpasswd, .DS_Store).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# PHP rules
location / {
try_files $uri $uri/ /index.php$is_args$args;
}

location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php_fpm;
}

location ~ .*\.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php_fpm;
}
error_page 404 /index.php;

# support folder redirects with and without trailing slashes
location ~ "^(.*)[^/]$" {
if (-d $document_root$uri) {
rewrite ^ $redirect_scheme://$http_host$uri/ permanent;
}
}
location ~ /\.ht {
deny all;
}

0 comments on commit 50c40c5

Please sign in to comment.