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 4db8b0e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 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;
1 change: 1 addition & 0 deletions .github/local_settings_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CALLBACK_BASE_URL = os.getenv('CALLBACK_BASE_URL')
if os.getenv('ALLOWED_HOSTS'):
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS').split(',')
print(ALLOWED_HOSTS)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATABASES = {
'default': {
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ matplotlib
django-bootstrap-datepicker-plus==3.0.5
django-mathfilters
django-bootstrap3
django-csp
django-csp

c2c4ZGV5cnoxZWNTWlhGazU4QXNrU0E1YjZHcUVCWnVGWTZqOGxvNTQ5WS5SS3llVnJ6LVJxN3h0Y19MUWFqcXVkc1c3OWc=

0 comments on commit 4db8b0e

Please sign in to comment.