Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,20 @@ server {
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_URI $request_uri;
}

# this is a workaround to get iipsrv's default "homepage"
# to work as a healthcheck that's not tied to any specific
# image resource. it intentionally overrides PATH_INFO
# and does not send QUERY_STRING.
#
# @see ruven/iipsrv#190
location /health {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param PATH_INFO /;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_URI $request_uri;
}
}
1 change: 1 addition & 0 deletions test/health.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><title>IIPImage Server</title><meta name="DC.creator" content="Ruven Pillay &lt;ruven@users.sourceforge.net&gt;"/><meta name="DC.title" content="IIPImage Server"/><meta name="DC.source" content="https://iipimage.sourceforge.io"/></head><body style="font-family:Helvetica,sans-serif; margin:4em"><center><h1>IIPImage Server</h1><h2>Version 1.3</h2><br/><h3>Project Home Page: <a href="https://iipimage.sourceforge.io">https://iipimage.sourceforge.io</a></h3><br/><h4>by<br/>Ruven Pillay</h4></center></body></html>
14 changes: 14 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ assert_identical() {
############################################################
# Fixture

HEALTHCHECK_URL='http://localhost/health'
INFO_URL='http://localhost/iiif/test.tif/info.json'
IMAGE_URL='http://localhost/iiif/test.tif/full/64,/0/default.jpg'

EXPECTED_HEALTHCHECK_PATH="test/health.html"
EXPECTED_INFO_PATH="test/info.json"
EXPECTED_IMAGE_PATH="test/default.jpg"

ARTIFACTS_DIR="artifacts"
ACTUAL_HEALTHCHECK_PATH="${ARTIFACTS_DIR}/health.html"
ACTUAL_INFO_PATH="${ARTIFACTS_DIR}/info.json"
ACTUAL_IMAGE_PATH="${ARTIFACTS_DIR}/default.jpg"

Expand All @@ -73,6 +76,17 @@ echo
############################################################
# Tests

echo '------------------------------------------------------------'
echo 'Making healthcheck request:'
echo
download "${HEALTHCHECK_URL}" "${ACTUAL_HEALTHCHECK_PATH}"
echo

echo '------------------------------------------------------------'
echo 'Verifying healthcheck result:'
echo
assert_identical "${EXPECTED_HEALTHCHECK_PATH}" "${ACTUAL_HEALTHCHECK_PATH}"

echo '------------------------------------------------------------'
echo 'Making IIIF info request:'
echo
Expand Down