fix container nginx conf

This commit is contained in:
tawoe 2024-10-23 14:22:56 +02:00
parent 878e807a74
commit 714bd27f0b
3 changed files with 23 additions and 5 deletions

View File

@ -15,7 +15,7 @@ RUN python ./apimanager/manage.py collectstatic --noinput
FROM registry.access.redhat.com/ubi9/nginx-120 FROM registry.access.redhat.com/ubi9/nginx-120
USER 0 USER 0
RUN dnf update -y 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 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/ RUN chgrp -R 0 /opt/app-root/src/ && chmod -R g+rwX /opt/app-root/src/
USER 1001 USER 1001

View File

@ -1,5 +1,4 @@
server {
listen 8080;
server_name apimanager; server_name apimanager;
location / { location / {
@ -19,5 +18,4 @@ server {
} }
location /static { location /static {
alias /usr/share/nginx/html; alias /usr/share/nginx/html;
} }
}

20
.github/apimanager_oc.conf vendored Normal file
View File

@ -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;