Skip to content

Commit

Permalink
fix container nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
tawoe committed Oct 23, 2024
1 parent 878e807 commit 714bd27
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/Dockerfile_nginx_OC
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions .github/apimanager.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
server {
listen 8080;

server_name apimanager;

location / {
Expand All @@ -19,5 +18,4 @@ server {
}
location /static {
alias /usr/share/nginx/html;
}
}
}
20 changes: 20 additions & 0 deletions .github/apimanager_oc.conf
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 714bd27

Please sign in to comment.