diff --git a/Dockerfile b/Dockerfile index 83be11124a5f29739d9eec1be917877e9bf2ee1f..cb392f3b30c0b61015dacbb1e0a337cc8a573125 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ FROM nginx # copy artifact build from the 'build environment' RUN apt-get update -COPY --from=build /app/dist/fr /usr/share/nginx/html +COPY --from=build /app/dist/fr /usr/share/nginx/html/fr RUN touch /var/run/nginx.pid RUN ls -l /usr/share/nginx/html diff --git a/nginx/dev.conf b/nginx/dev.conf index 8ebba545b69ddaa68bdec60dce4d8eff8109e700..0ec8e46c464e62745120cb4c04c99df55e37c97c 100644 --- a/nginx/dev.conf +++ b/nginx/dev.conf @@ -7,11 +7,17 @@ server { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; + sub_filter '<html lang="en">' '<html lang="fr">'; } - location /api { - rewrite ^/api/(.*) /$1 break; - proxy_pass http://json-server:3000/api; - } + # Rule serving the en build + location /en { + try_files $uri$args /en/index.html; + } + + # redirecting the /fr url to the new location of the fr build + location ~ ^/fr(.*)$ { + return 301 $scheme://$http_host$1$is_args$args; + } }