From 714bd27f0b67f73837890765ca083d53bc17a22a Mon Sep 17 00:00:00 2001 From: tawoe Date: Wed, 23 Oct 2024 14:22:56 +0200 Subject: [PATCH] fix container nginx conf --- .github/Dockerfile_nginx_OC | 2 +- .github/apimanager.conf | 6 ++---- .github/apimanager_oc.conf | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .github/apimanager_oc.conf diff --git a/.github/Dockerfile_nginx_OC b/.github/Dockerfile_nginx_OC index e8c59a9..c115808 100644 --- a/.github/Dockerfile_nginx_OC +++ b/.github/Dockerfile_nginx_OC @@ -15,7 +15,7 @@ RUN python ./apimanager/manage.py collectstatic --noinput FROM registry.access.redhat.com/ubi9/nginx-120 USER 0 RUN dnf update -y -ADD .github/apimanager.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD .github/apimanager_oc.conf "${NGINX_DEFAULT_CONF_PATH}" COPY --from=builder /app/apimanager/static /opt/app-root/src RUN chgrp -R 0 /opt/app-root/src/ && chmod -R g+rwX /opt/app-root/src/ USER 1001 diff --git a/.github/apimanager.conf b/.github/apimanager.conf index 132d3d8..44b11cb 100644 --- a/.github/apimanager.conf +++ b/.github/apimanager.conf @@ -1,5 +1,4 @@ -server { - listen 8080; + server_name apimanager; location / { @@ -19,5 +18,4 @@ server { } location /static { alias /usr/share/nginx/html; - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/.github/apimanager_oc.conf b/.github/apimanager_oc.conf new file mode 100644 index 0000000..d361883 --- /dev/null +++ b/.github/apimanager_oc.conf @@ -0,0 +1,20 @@ + + server_name apimanager; + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # enable this if and only if you use HTTPS + # proxy_set_header X-Forwarded-Proto https; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_pass http://127.0.0.1:8000; + } + + location /en/static { + alias /opt/app-root/src; + } + location /es/static { + alias /opt/app-root/src; + } + location /static { + alias /opt/app-root/src; \ No newline at end of file