From f9c80f9a121cc375dacde4738f8ac03f9644602a Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 9 Oct 2024 14:42:22 -0600 Subject: [PATCH] added nginx.conf --- nginx.conf | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..8e8fc75 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,76 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format json_combined escape=json + '{' + '"time_local":"$time_local",' + '"remote_addr":"$remote_addr",' + '"remote_user":"$remote_user",' + '"request":"$request",' + '"request_id":"$request_id",' + '"request_host":"$host",' + '"response_status": "$status",' + '"body_bytes_sent":"$body_bytes_sent",' + '"request_time":"$request_time",' + '"http_referrer":"$http_referer",' + '"http_user_agent":"$http_user_agent"' + '}'; + + access_log /var/log/nginx/access.log json_combined; + + sendfile on; + + keepalive_timeout 65; + + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_min_length 512; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss application/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon font/woff2; + + map $sent_http_content_type $cache_expires { + default off; + text/html epoch; + text/css max; + application/javascript max; + ~image/ max; + } + + server { + listen 80; + listen [::]:80; + + access_log /dev/stdout; + error_log /dev/stderr error; + + expires $cache_expires; + + root /usr/share/nginx/html; + try_files $uri /index.html; + } + + # Healthcheck + server { + listen 8080; + + location /health { + add_header Content-Type text/plain; + return 200 'OK'; + } + } +}