summaryrefslogtreecommitdiff
path: root/nginx.conf
diff options
context:
space:
mode:
authorMax Nanis2026-02-19 02:43:23 -0500
committerMax Nanis2026-02-19 02:43:23 -0500
commitf0f96f83c2630e890a2cbcab53f77fd4c37e1684 (patch)
treec6d2cb092e76bf5d499e0ea9949508d6b22164fd /nginx.conf
parent3eaa56f0306ead818f64c3d99fc6d230d9b970a4 (diff)
downloadamt-jb-master.tar.gz
amt-jb-master.zip
Models, Project files, some pytests, requirements.. etcHEADmaster
Diffstat (limited to 'nginx.conf')
-rw-r--r--nginx.conf39
1 files changed, 39 insertions, 0 deletions
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..d58f4b1
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,39 @@
+user www-data;
+worker_processes 1;
+pid /run/nginx.pid;
+include /etc/nginx/modules-enabled/*.conf;
+events {
+ worker_connections 512;
+}
+http {
+ include /etc/nginx/conf.d/*.conf;
+ include /etc/nginx/sites-enabled/*;
+
+ # `$upstream_http_x_route` and $upstream_http_x_cache_hit are custom headers set by me in the flask app
+ # All values needs to be in quotes b/c if a variable is empty, it puts '-' which is not valid json
+ log_format json_logs escape=json '{'
+ '"time_local":"$time_local",'
+ '"time":"$msec",'
+ '"client":"$remote_addr",'
+ '"forwarded_for":"$http_x_forwarded_for",'
+ '"method":"$request_method",'
+ '"request":"$request",'
+ '"request_length":"$request_length",'
+ '"status":"$status",'
+ '"bytes_sent":"$bytes_sent",'
+ '"referer":"$http_referer",'
+ '"user_agent":"$http_user_agent",'
+ '"upstream_status":"$upstream_status",'
+ '"request_time":"$request_time",'
+ '"upstream_response_time":"$upstream_response_time",'
+ '"upstream_connect_time":"$upstream_connect_time",'
+ '"upstream_header_time":"$upstream_header_time",'
+ '"upstream_route":"$upstream_http_x_route",'
+ '"upstream_cache_hit":"$upstream_http_x_cache_hit",'
+ '"host":"$host",'
+ '"http_host":"$http_host"'
+ '}';
+
+ access_log /var/log/nginx/access.log json_logs;
+ error_log /var/log/nginx/error.log;
+} \ No newline at end of file