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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Variable | Example | Description
--- | --- | ---
`SERVER_MAX_BODY_SIZE` | `SERVER_MAX_BODY_SIZE=4M` | Allows the downstream application to specify a non-default `client_max_body_size` configuration for the `server`-level directive in `/etc/nginx/sites-available/default`
`SERVER_INDEX` | `SERVER_INDEX index.html index.html index.php` | Changes the default pages to hit for folder and web roots
`SERVER_APP_NAME` | `APP_NAME='view'` | Sets a kv pair to be consumed by logging service for easy parsing and searching
5 changes: 3 additions & 2 deletions container/root/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ sed -i "s/worker_processes [0-9]\+/worker_processes $(nproc)/" $CONFIG_SERVER
sed -i "s/worker_connections [0-9]\+/worker_connections 1024/" $CONFIG_SERVER

echo '[nginx] piping logs to STDOUT'

sed -i "s/access_log [a-z\/\.\;]\+/access_log \/dev\/stdout;/" $CONFIG_SERVER
# Ensure nginx is configured to write logs to STDOUT
# Also set log_format to output SERVER_APP_NAME placeholder
sed -i "s/access_log [a-z\/\.\;]\+/ log_format main \'\$remote_addr - \$remote_user [\$time_local] \"\$request\" \$status \$bytes_sent \"\$http_referer\" \"\$http_user_agent\" SERVER_APP_NAME\';\n access_log \/dev\/stdout main;\n/" $CONFIG_SERVER
sed -i "s/error_log [a-z\/\.\ \;]\+/error_log \/dev\/stdout info;/" $CONFIG_SERVER

if [[ $SERVER_MAX_BODY_SIZE ]]
Expand Down