From 7d4c7af84c5c4a1c986e1c957c718c97dd96ea51 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sat, 5 Jul 2025 19:41:55 +0200 Subject: feat(nginx): add initial nginx configuration * Set up server to listen on port 80 * Define root directory and index files * Configure caching for static assets * Implement error handling for 404 pages --- nginx.conf | 23 +++++++++++++++++++++++ nginx/nginx.conf | 17 ----------------- 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 nginx.conf delete mode 100644 nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..4b8416e --- /dev/null +++ b/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + listen [::]:80; + server_name _; + + root /usr/share/nginx/html; + index index.html index.htm; + + location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|otf|webp)$ { + expires 30d; + access_log off; + add_header Cache-Control "public"; + } + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /404.html; + location = /404.html { + internal; + } +} \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 822dd29..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,17 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name _; - - root /usr/share/nginx/html; - index index.html index.htm; - - location / { - try_files $uri $uri/ /index.html; - } - - error_page 404 /404.html; - location = /404.html { - internal; - } -} \ No newline at end of file -- cgit v1.2.3