Skip to content

Commit 5642e89

Browse files
committed
Cache static files and make htdocs the root
1 parent ae32489 commit 5642e89

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docker/nginx-default.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ server {
99
error_log stderr warn;
1010
access_log /dev/stdout main;
1111

12-
root /var/www/phpldapadmin;
12+
root /var/www/phpldapadmin/htdocs;
1313
client_max_body_size 10M;
1414

1515
location /.nginx/status {
@@ -27,9 +27,9 @@ server {
2727
return 200 "User-agent: *\nDisallow: /";
2828
}
2929

30-
# Deny for accessing codes
31-
location ~ ^/(lib|locale|tools|hooks|config)/ {
32-
return 403;
30+
location ~ ^/(css|js|images)$ {
31+
access_log off;
32+
expires max;
3333
}
3434

3535
location ~ \.php$ {

test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ checkUrl "http://${TEST_ADDR}/.phpfpm/status" -I
3636
checkUrl "http://${TEST_ADDR}/index.php" -I
3737
checkUrl "http://${TEST_ADDR}/robots.txt" -I
3838

39-
checkUrl "http://${TEST_ADDR}/index.php" -L | grep -q -F "1.2.6.4"
40-
checkUrl "http://${TEST_ADDR}/htdocs/cmd.php" "form" "cmd=login&server_id=1&nodecode%5Blogin_pass%5D=1&login=cn%3Dadmin%2Cdc%3Dexample%2Cdc%3Dorg&login_pass=ldapadminpass&submit=Authenticate" | grep -q -F "Successfully logged into server."
39+
checkUrl "http://${TEST_ADDR}/index.php" | grep -q -F "1.2.6.4"
40+
checkUrl "http://${TEST_ADDR}/cmd.php" "form" "cmd=login&server_id=1&nodecode%5Blogin_pass%5D=1&login=cn%3Dadmin%2Cdc%3Dexample%2Cdc%3Dorg&login_pass=ldapadminpass&submit=Authenticate" | grep -q -F "Successfully logged into server."
4141

4242
if [ $DID_FAIL -gt 0 ]; then
4343
echo "Some URLs failed"

0 commit comments

Comments
 (0)