From 56777a809eac08f5694098eea56f757a4b111b90 Mon Sep 17 00:00:00 2001 From: mohassani1 Date: Thu, 27 Jun 2024 19:21:20 +0200 Subject: [PATCH] :bug: fix nginx --- docker/Dockerfile | 6 ++++++ nginx.conf | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 nginx.conf diff --git a/docker/Dockerfile b/docker/Dockerfile index be2fcf0..cef6da2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,13 @@ FROM nginx:alpine +# Remove default configuration +RUN rm /etc/nginx/conf.d/default.conf + # Copy application files COPY . /var/www/html/ +# Copy Nginx configuration file +COPY nginx.conf /etc/nginx/conf.d/default.conf + # Expose port 80 EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..90d49e2 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name codefirst.iut.uca.fr; + + root /var/www/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /assets/ { + alias /var/www/html/assets/; + } +}