From 2d66c4d94feabe36fd969e7bee9b3140ea947f8d Mon Sep 17 00:00:00 2001 From: metas-jb Date: Thu, 11 Nov 2021 11:52:57 +0100 Subject: [PATCH] #72 add new apache redirects to webui --- .../sources/configs/metasfresh_webui.conf | 10 +++- .../sources/configs/metasfresh_webui_ssl.conf | 55 +++++++++---------- webui/sources/configs/metasfresh_webui.conf | 18 +++++- .../sources/configs/metasfresh_webui_ssl.conf | 20 ++++++- 4 files changed, 71 insertions(+), 32 deletions(-) diff --git a/docker-src/webui/sources/configs/metasfresh_webui.conf b/docker-src/webui/sources/configs/metasfresh_webui.conf index 3d2556a..1571a6c 100644 --- a/docker-src/webui/sources/configs/metasfresh_webui.conf +++ b/docker-src/webui/sources/configs/metasfresh_webui.conf @@ -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 + diff --git a/docker-src/webui/sources/configs/metasfresh_webui_ssl.conf b/docker-src/webui/sources/configs/metasfresh_webui_ssl.conf index a00103f..2aa430b 100644 --- a/docker-src/webui/sources/configs/metasfresh_webui_ssl.conf +++ b/docker-src/webui/sources/configs/metasfresh_webui_ssl.conf @@ -2,10 +2,18 @@ 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 + Order allow,deny Allow from all @@ -78,33 +86,24 @@ Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT" - - 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 - - - - 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" - + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + RewriteEngine On - - 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" - + # 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 + SSLCertificateFile /etc/apache2/certs/fullchain.pem SSLCertificateKeyFile /etc/apache2/certs/privkey.pem diff --git a/webui/sources/configs/metasfresh_webui.conf b/webui/sources/configs/metasfresh_webui.conf index 10a8bf9..8178044 100644 --- a/webui/sources/configs/metasfresh_webui.conf +++ b/webui/sources/configs/metasfresh_webui.conf @@ -1,8 +1,17 @@ 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 + Order allow,deny Allow from all @@ -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 diff --git a/webui/sources/configs/metasfresh_webui_ssl.conf b/webui/sources/configs/metasfresh_webui_ssl.conf index bc8c44b..2e78f2d 100644 --- a/webui/sources/configs/metasfresh_webui_ssl.conf +++ b/webui/sources/configs/metasfresh_webui_ssl.conf @@ -2,8 +2,17 @@ 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 + Order allow,deny Allow from 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 @@ -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