Skip to content

Commit d700b7d

Browse files
authored
Merge pull request #628 from itk-dev/hotfix/ngingx-bug
Updated nginx config
2 parents 590f68f + d22ab52 commit d700b7d

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

.docker/nginx.conf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,3 @@ http {
3535
include /etc/nginx/conf.d/*.conf;
3636
}
3737

38-
# Define which paths to protect
39-
location ~ ^/(flag/flag|admin|user/login) {
40-
# Block bots on these paths only
41-
if ($http_user_agent ~* (bot|crawler|spider|scraper)) {
42-
return 403;
43-
}
44-
45-
if ($http_referer = "") {
46-
return 403;
47-
}
48-
}

.docker/templates/default.conf.template

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ server {
8686
fastcgi_pass ${NGINX_FPM_SERVICE};
8787
}
8888

89+
# Define which paths to protect
90+
location ~ ^/(flag/flag|admin|user/login) {
91+
# Block bots on these paths only
92+
if ($http_user_agent ~* (bot|crawler|spider|scraper)) {
93+
return 403;
94+
}
95+
96+
try_files $uri /index.php?$query_string;
97+
}
98+
8999
# Enforce clean URLs
90100
#
91101
# Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page

0 commit comments

Comments
 (0)