Skip to content

Commit 07d58db

Browse files
committed
[Added] Added further useful nginx config items
1 parent fc00fde commit 07d58db

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nginx.app.conf

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ location ~ /\. {
55
deny all;
66
}
77

8+
# 301 Redirect URLs with trailing /'s as per https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html
9+
rewrite ^/(.*)/$ /$1 permanent;
10+
11+
# Change // -> / for all URLs, so it works for our php location block, too
12+
merge_slashes off;
13+
rewrite (.*)//+(.*) $1/$2 permanent;
14+
15+
# For WordPress bots/users
16+
location ~ ^/(wp-login|wp-admin|wp-config|wp-content|wp-includes|(.*)\.exe) {
17+
return 301 https://wordpress.com/wp-login.php;
18+
}
19+
20+
# Access Log
21+
access_log off;
22+
823
location = /favicon.ico {
924
log_not_found off;
1025
}

0 commit comments

Comments
 (0)