From c62633bd23a721110640d8d20c40a19c0593db37 Mon Sep 17 00:00:00 2001 From: azurejelly <178000437+azurejelly@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:17:17 -0400 Subject: [PATCH] chore(docker): move nginx config to a separate folder Also kept the example SSL config from #82 in case it is useful to someone --- Dockerfile | 4 ++-- nginx/default-ssl.conf | 26 ++++++++++++++++++++++++++ nginx/default.conf | 15 +++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 nginx/default-ssl.conf create mode 100644 nginx/default.conf diff --git a/Dockerfile b/Dockerfile index 5ae62a4..e076900 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,6 @@ RUN bun run build FROM nginx:stable-alpine -COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf -COPY --from=builder /app/build /usr/share/nginx/html +COPY --from=builder /app/build /usr/share/nginx/html \ No newline at end of file diff --git a/nginx/default-ssl.conf b/nginx/default-ssl.conf new file mode 100644 index 0000000..ad3dad4 --- /dev/null +++ b/nginx/default-ssl.conf @@ -0,0 +1,26 @@ +server { + listen 80; + server_name vert; + + # Redirect all HTTP traffic to HTTPS + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + server_name vert; + + ssl_certificate /etc/ssl/vert/vert.crt; + ssl_certificate_key /etc/ssl/vert/vert.key; + + root /usr/share/nginx/html; + index index.html; + + client_max_body_size 10M; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /index.html; +} \ No newline at end of file diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..b8f487b --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name vert; + + root /usr/share/nginx/html; + index index.html; + + client_max_body_size 10M; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /index.html; +} \ No newline at end of file