From a6c2e8681d953cd3b742a2c08371297bef7a10f8 Mon Sep 17 00:00:00 2001 From: Ihor_Zhekov Date: Mon, 9 Feb 2026 14:31:51 +0100 Subject: [PATCH] 4 --- Dockerfile | 6 +----- vhost.conf | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 vhost.conf diff --git a/Dockerfile b/Dockerfile index 9b4fdf4..f86b77c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ FROM webdevops/php-nginx:8.2-alpine ENV WEB_DOCUMENT_ROOT=/app - COPY ["Profice WebSite/", "/app/"] -RUN echo 'location / { \ - try_files $uri $uri/ $uri.html /index.php?$query_string; \ - index index.html index.php; \ -}' > /opt/docker/etc/nginx/vhost.common.d/10-location-root.conf +COPY vhost.conf /opt/docker/etc/nginx/vhost.common.d/10-location-root.conf RUN chown -R application:application /app && chmod -R 755 /app diff --git a/vhost.conf b/vhost.conf new file mode 100644 index 0000000..444cdf4 --- /dev/null +++ b/vhost.conf @@ -0,0 +1,15 @@ + +index index.html index.php; + +location / { + if ($request_uri ~ ^/index(\.html)?$) { + return 301 /; + } + + if ($request_uri ~ ^/(.*)\.html$) { + return 301 /$1; + } + + + try_files $uri $uri/ $uri.html /sites$uri /sites$uri.html /index.php?$query_string; +} \ No newline at end of file