Skip to content

Commit

Permalink
Docker: Add default apache config to the GUI container
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed Jan 29, 2024
1 parent 9593916 commit d74b7ec
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions dashboard-gui/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FROM ghcr.io/openconext/openconext-basecontainers/apache2-shibboleth:latest
COPY ./conf/000-default.conf /etc/apache2/sites-enabled/
COPY ./build/ /var/www/
69 changes: 69 additions & 0 deletions dashboard-gui/docker/conf/000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

ServerName dashboard

RewriteEngine on

RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.(js|css)(\.map)?$
RewriteCond %{REQUEST_URI} !\.svg$
RewriteCond %{REQUEST_URI} !\.png$
RewriteCond %{REQUEST_URI} !\.ico$
RewriteCond %{REQUEST_URI} !\.woff$
RewriteCond %{REQUEST_URI} !\.woff2$
RewriteCond %{REQUEST_URI} !\.ttf$
RewriteCond %{REQUEST_URI} !\.eot$
RewriteCond %{REQUEST_URI} !^/(asset-)?manifest.json$
RewriteCond %{REQUEST_URI} !^/dashboard
RewriteCond %{REQUEST_URI} !^/spDashboard
RewriteCond %{REQUEST_URI} !^/health
RewriteCond %{REQUEST_URI} !^/info
RewriteCond %{REQUEST_URI} !^/internal
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_URI} !^/startSSO
RewriteCond %{REQUEST_URI} !^/fonts
RewriteRule (.*) /index.html [L]

ProxyPreserveHost On
ProxyPass /Shibboleth.sso !
ProxyPass /dashboard/api http://dashboardserver:8080/dashboard/api retry=0
ProxyPassReverse /dashboard/api http://dashboardserver:8080/dashboard/api

ProxyPass /health http://dashboardserver:8080/internal/health retry=0
ProxyPass /info http://dashboardserver:8080/internal/info retry=0
ProxyPass /login http://dashboardserver:8080/login retry=0
ProxyPass /startSSO http://dashboardserver:8080/startSSO retry=0

ProxyPass /spDashboard/api http://dashboardserver:8080/spDashboard/api retry=0
ProxyPassReverse /spDashboard/api http://dashboardserver:8080/spDashboard/api

ProxyPass /internal http://dashboardserver:8080/internal retry=0
ProxyPassReverse /internal http://dashboardserver:8080/internal

<Location />
AuthType shibboleth
ShibUseHeaders On
ShibRequireSession On
Require valid-user
</Location>

DocumentRoot "/var/www/"

<Directory "/var/www/">
Require all granted
</Directory>

<Location ~ "/(health|info)">
Require all granted
</Location>

<Location ~ "/internal/(health|info)">
Require all granted
</Location>

<Location ~ "^/(?!startSSO)">
Require all granted
</Location>

Header always set X-Frame-Options "DENY"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set X-Content-Type-Options "nosniff"

0 comments on commit d74b7ec

Please sign in to comment.