Skip to content

Commit

Permalink
#72 add new apache redirects to webui
Browse files Browse the repository at this point in the history
  • Loading branch information
metas-jb committed Nov 11, 2021
1 parent 2615215 commit 2d66c4d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 32 deletions.
10 changes: 9 additions & 1 deletion docker-src/webui/sources/configs/metasfresh_webui.conf
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@
AllowOverride All
Require all granted
RewriteEngine On

# Existing file or directory
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/mobile?$
RewriteRule ^ - [L]

# mobile UI
RewriteCond %{REQUEST_URI} ^/mobile
RewriteRule ^ /mobile/index.html [L]

# Fallback:
RewriteRule ^ /index.html
</Directory>

</VirtualHost>
55 changes: 27 additions & 28 deletions docker-src/webui/sources/configs/metasfresh_webui_ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
<VirtualHost *:443>
ProxyRequests Off
DocumentRoot /opt/metasfresh-webui-frontend/dist/
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined


# Logging
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined

# Debugging
# NOTE: pls comment the ErrorLog and CustomLog entries above
#ErrorLog /dev/stdout
#TransferLog /dev/stdout
#LogLevel alert rewrite:trace8

<Location /rest>
Order allow,deny
Allow from all
Expand Down Expand Up @@ -78,33 +86,24 @@
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
</Location>

<Directory /opt/metasfresh-webui-frontend/dist/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/mobile?$
RewriteRule ^ - [L]
RewriteRule ^ /index.html
</Directory>

<Files index.html>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
</Files>
<Directory /opt/metasfresh-webui-frontend/dist/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On

<Files service-worker.js>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
</Files>
# Existing file or directory
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# mobile UI
RewriteCond %{REQUEST_URI} ^/mobile
RewriteRule ^ /mobile/index.html [L]

# Fallback:
RewriteRule ^ /index.html
</Directory>

SSLCertificateFile /etc/apache2/certs/fullchain.pem
SSLCertificateKeyFile /etc/apache2/certs/privkey.pem
Expand Down
18 changes: 17 additions & 1 deletion webui/sources/configs/metasfresh_webui.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<VirtualHost *:80>
ProxyRequests Off
DocumentRoot /opt/metasfresh-webui-frontend/dist/

# Logging
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined

# Debugging
# NOTE: pls comment the ErrorLog and CustomLog entries above
#ErrorLog /dev/stdout
#TransferLog /dev/stdout
#LogLevel alert rewrite:trace8

<Location /rest>
Order allow,deny
Allow from all
Expand Down Expand Up @@ -87,10 +96,17 @@
AllowOverride All
Require all granted
RewriteEngine On

# Existing file or directory
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/mobile?$
RewriteRule ^ - [L]

# mobile UI
RewriteCond %{REQUEST_URI} ^/mobile
RewriteRule ^ /mobile/index.html [L]

# Fallback:
RewriteRule ^ /index.html
</Directory>

Expand Down
20 changes: 18 additions & 2 deletions webui/sources/configs/metasfresh_webui_ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
<VirtualHost *:443>
ProxyRequests Off
DocumentRoot /opt/metasfresh-webui-frontend/dist/

# Logging
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined

# Debugging
# NOTE: pls comment the ErrorLog and CustomLog entries above
#ErrorLog /dev/stdout
#TransferLog /dev/stdout
#LogLevel alert rewrite:trace8

<Location /rest>
Order allow,deny
Allow from all
Expand All @@ -17,7 +26,7 @@
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
ProxyPass wss://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse wss://webapi:8080/stomp/
ProxyPass http://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
Expand Down Expand Up @@ -88,10 +97,17 @@
AllowOverride All
Require all granted
RewriteEngine On

# Existing file or directory
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/mobile?$
RewriteRule ^ - [L]

# mobile UI
RewriteCond %{REQUEST_URI} ^/mobile
RewriteRule ^ /mobile/index.html [L]

# Fallback:
RewriteRule ^ /index.html
</Directory>

Expand Down

0 comments on commit 2d66c4d

Please sign in to comment.