From 3763a2b39c3ced908212317779008bb8068fe9ec Mon Sep 17 00:00:00 2001 From: Kyllian Chabanon Date: Fri, 4 Apr 2025 16:12:19 +0200 Subject: [PATCH] Modification nginx.conf --- Dockerfile | 2 +- nginx.conf | 31 +++++++------------------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74a630f..b6afe99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,4 @@ RUN npm run build FROM nginx:1.19-alpine COPY --from=build /app/build /usr/share/nginx/html -COPY nginx.conf /etc/nginx/nginx.conf \ No newline at end of file +COPY nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 502d2c7..e2e9700 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,26 +1,9 @@ -# Directive globale -worker_processes 1; +server { + listen 80; -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - - server { - listen 80; - server_name localhost; - - location /containers/kyllianchabanon-portfolio/ { - root /usr/share/nginx/html; # Assure-toi que ce répertoire contient index.html - try_files $uri $uri/ /containers/kyllianchabanon-portfolio/index.html; # Redirige vers index.html dans le sous-dossier - } - - location ~* \.(css|js|json|jpg|jpeg|png|gif|ico)$ { - root /usr/share/nginx/html; - try_files $uri =404; # Sert les fichiers statiques correctement - } + location /containers/kyllianchabanon-portfolio { + alias /usr/share/nginx/html; + try_files $uri $uri/ /containers/kyllianchabanon-portfolio/index.html; + index index.html; } -} +} \ No newline at end of file