From 19263c10c59409e834c141803057f9b0c0484a74 Mon Sep 17 00:00:00 2001 From: David Weber Date: Thu, 19 Oct 2023 15:01:01 +0200 Subject: [PATCH] chore: initial commit --- nginx/default.conf | 8 ++++---- nginx/file-browser.conf | 6 +++--- nginx/nginx.conf | 22 ++++++++++++---------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/nginx/default.conf b/nginx/default.conf index 8afa89a..0da4d7a 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,14 +1,14 @@ # default config for single-page apps server { - listen 8080; - root /usr/share/nginx/html; + listen 8080; + root /usr/share/nginx/html; location ~ ^/(css|js)/ { # These assets include a unique hash in the filename, so they will never change expires max; } - location ~* ^.+\.(html]htm)$ { + location ~* ^.+\.(html|htm)$ { # Very short caching time to ensure changes are immediately recognized expires 5m; } @@ -16,4 +16,4 @@ server { location / { try_files $uri $uri/ /index.html =404; } -} \ No newline at end of file +} diff --git a/nginx/file-browser.conf b/nginx/file-browser.conf index de1328d..b592d8d 100644 --- a/nginx/file-browser.conf +++ b/nginx/file-browser.conf @@ -1,8 +1,8 @@ server { - listen 8080; - root /usr/share/nginx/html; + listen 8080; + root /usr/share/nginx/html; location / { autoindex on; } -} \ No newline at end of file +} diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 8d3663a..3a280bb 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,19 +1,21 @@ -worker_processes 1; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/cache/nginx/nginx.pid; -error_log /var/log/nginx/error.log warn; -pid /var/cache/nginx/nginx.pid; events { - worker_connections 1024; + worker_connections 1024; } + http { - include /etc/nginx/mime.types; - default_type application/octet-stream; + include /etc/nginx/mime.types; + default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_X_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; access_log off; @@ -26,4 +28,4 @@ http { gzip_types text/plain text/css text/javascript application/javascript application/xml application/pdf image/svg+xml; include /etc/nginx/conf.d/default.conf; -} \ No newline at end of file +}