Skip to content

Commit

Permalink
feat(docker): exclude /healthcheck from access logs (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLicense committed Aug 30, 2024
1 parent 9f316af commit f2b889e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions infra/docker/api/api.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
map $request_uri $should_log {
default 1;
# The security group healthcheck endpoint.
~^/healthcheck 0;
}

server {
listen 8080;
listen [::]:8080;
Expand All @@ -6,6 +12,8 @@ server {

root /var/www/html/public;

access_log /dev/stdout main if=$should_log;

# Prevent some browsers from MIME-sniffing the response.
#
# This reduces exposure to drive-by download attacks and cross-origin data
Expand Down
8 changes: 8 additions & 0 deletions infra/docker/internal/internal.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
map $request_uri $should_log {
default 1;
# The security group healthcheck endpoint.
~^/healthcheck 0;
}

# Add Access-Control-Allow-Origin.
map $sent_http_content_type $cors {
# Images
Expand Down Expand Up @@ -31,6 +37,8 @@ server {

root /var/www/html/public;

access_log /dev/stdout main if=$should_log;

# Protect website against clickjacking.
#
# The example below sends the `X-Frame-Options` response header with the value
Expand Down
8 changes: 8 additions & 0 deletions infra/docker/selfserve/selfserve.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
map $request_uri $should_log {
default 1;
# The security group healthcheck endpoint.
~^/healthcheck 0;
}

# Add Access-Control-Allow-Origin.
map $sent_http_content_type $cors {
# Images
Expand Down Expand Up @@ -31,6 +37,8 @@ server {

root /var/www/html/public;

access_log /dev/stdout main if=$should_log;

# Protect website against clickjacking.
#
# The example below sends the `X-Frame-Options` response header with the value
Expand Down

0 comments on commit f2b889e

Please sign in to comment.