Skip to content

Commit 6dbee55

Browse files
committed
Update nginx config for Drupal/Wordpress
1 parent ad57c8b commit 6dbee55

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

conf/nginx-site.conf

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77

88
# Make site accessible from http://localhost/
99
server_name _;
10-
10+
1111
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
1212
sendfile off;
1313

@@ -19,10 +19,29 @@ server {
1919
#real_ip_header X-Forwarded-For;
2020
#set_real_ip_from 172.16.0.0/12;
2121

22+
# TS Customizations
23+
# Web fonts support.
24+
location ~* \.(eot|ttf|woff|woff2|otf|svg)$ {
25+
#auth_basic $auth_basic_realm;
26+
add_header Access-Control-Allow-Origin *; # Firefox needs this.
27+
28+
29+
# Catch auth-basic failures
30+
error_page 401 /locked.html;
31+
32+
expires -1;
33+
log_not_found off;
34+
}
35+
2236
location / {
23-
# First attempt to serve request as file, then
24-
# as directory, then fall back to index.html
25-
try_files $uri $uri/ =404;
37+
#auth_basic $auth_basic_realm;
38+
# @drupal is true for d6, d7 and d8. We want to use @cleanurl for d6 and d7.
39+
try_files $uri $uri/ /index.php?$args;
40+
# Catch directory listing errors (i.e. no code)
41+
error_page 403 =561 /403.html;
42+
#error_page 301 =301 $client_scheme://$host$uri/$is_args$args;
43+
# Catch auth-basic failures
44+
error_page 401 /locked.html;
2645
}
2746

2847
error_page 404 /404.html;
@@ -60,10 +79,10 @@ server {
6079
# deny access to . files, for security
6180
#
6281
location ~ /\. {
63-
log_not_found off;
82+
log_not_found off;
6483
deny all;
6584
}
66-
85+
6786
location ^~ /.well-known {
6887
allow all;
6988
auth_basic off;

0 commit comments

Comments
 (0)