Skip to content

Commit 2d66c4d

Browse files
committed
#72 add new apache redirects to webui
1 parent 2615215 commit 2d66c4d

File tree

4 files changed

+71
-32
lines changed

4 files changed

+71
-32
lines changed

docker-src/webui/sources/configs/metasfresh_webui.conf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,18 @@
8383
AllowOverride All
8484
Require all granted
8585
RewriteEngine On
86+
87+
# Existing file or directory
8688
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
8789
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
88-
RewriteCond %{REQUEST_URI} !^/mobile?$
8990
RewriteRule ^ - [L]
91+
92+
# mobile UI
93+
RewriteCond %{REQUEST_URI} ^/mobile
94+
RewriteRule ^ /mobile/index.html [L]
95+
96+
# Fallback:
9097
RewriteRule ^ /index.html
9198
</Directory>
99+
92100
</VirtualHost>

docker-src/webui/sources/configs/metasfresh_webui_ssl.conf

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
<VirtualHost *:443>
33
ProxyRequests Off
44
DocumentRoot /opt/metasfresh-webui-frontend/dist/
5-
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
6-
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
75

86

7+
# Logging
8+
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
9+
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
10+
11+
# Debugging
12+
# NOTE: pls comment the ErrorLog and CustomLog entries above
13+
#ErrorLog /dev/stdout
14+
#TransferLog /dev/stdout
15+
#LogLevel alert rewrite:trace8
16+
917
<Location /rest>
1018
Order allow,deny
1119
Allow from all
@@ -78,33 +86,24 @@
7886
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
7987
</Location>
8088

81-
<Directory /opt/metasfresh-webui-frontend/dist/>
82-
Options Indexes FollowSymLinks
83-
AllowOverride All
84-
Require all granted
85-
RewriteEngine On
86-
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
87-
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
88-
RewriteCond %{REQUEST_URI} !^/mobile?$
89-
RewriteRule ^ - [L]
90-
RewriteRule ^ /index.html
91-
</Directory>
92-
93-
<Files index.html>
94-
FileETag None
95-
Header unset ETag
96-
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
97-
Header set Pragma "no-cache"
98-
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
99-
</Files>
89+
<Directory /opt/metasfresh-webui-frontend/dist/>
90+
Options Indexes FollowSymLinks
91+
AllowOverride All
92+
Require all granted
93+
RewriteEngine On
10094

101-
<Files service-worker.js>
102-
FileETag None
103-
Header unset ETag
104-
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
105-
Header set Pragma "no-cache"
106-
Header set Expires "Wed, 21 Oct 2015 07:28:00 GMT"
107-
</Files>
95+
# Existing file or directory
96+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
97+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
98+
RewriteRule ^ - [L]
99+
100+
# mobile UI
101+
RewriteCond %{REQUEST_URI} ^/mobile
102+
RewriteRule ^ /mobile/index.html [L]
103+
104+
# Fallback:
105+
RewriteRule ^ /index.html
106+
</Directory>
108107

109108
SSLCertificateFile /etc/apache2/certs/fullchain.pem
110109
SSLCertificateKeyFile /etc/apache2/certs/privkey.pem

webui/sources/configs/metasfresh_webui.conf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<VirtualHost *:80>
22
ProxyRequests Off
33
DocumentRoot /opt/metasfresh-webui-frontend/dist/
4+
5+
# Logging
46
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
57
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
8+
9+
# Debugging
10+
# NOTE: pls comment the ErrorLog and CustomLog entries above
11+
#ErrorLog /dev/stdout
12+
#TransferLog /dev/stdout
13+
#LogLevel alert rewrite:trace8
14+
615
<Location /rest>
716
Order allow,deny
817
Allow from all
@@ -87,10 +96,17 @@
8796
AllowOverride All
8897
Require all granted
8998
RewriteEngine On
99+
100+
# Existing file or directory
90101
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
91102
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
92-
RewriteCond %{REQUEST_URI} !^/mobile?$
93103
RewriteRule ^ - [L]
104+
105+
# mobile UI
106+
RewriteCond %{REQUEST_URI} ^/mobile
107+
RewriteRule ^ /mobile/index.html [L]
108+
109+
# Fallback:
94110
RewriteRule ^ /index.html
95111
</Directory>
96112

webui/sources/configs/metasfresh_webui_ssl.conf

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
<VirtualHost *:443>
33
ProxyRequests Off
44
DocumentRoot /opt/metasfresh-webui-frontend/dist/
5+
6+
# Logging
57
ErrorLog ${APACHE_LOG_DIR}/webui_error.log
68
CustomLog ${APACHE_LOG_DIR}/webui_access.log combined
9+
10+
# Debugging
11+
# NOTE: pls comment the ErrorLog and CustomLog entries above
12+
#ErrorLog /dev/stdout
13+
#TransferLog /dev/stdout
14+
#LogLevel alert rewrite:trace8
15+
716
<Location /rest>
817
Order allow,deny
918
Allow from all
@@ -17,7 +26,7 @@
1726
RewriteEngine on
1827
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
1928
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
20-
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
29+
RewriteRule .* ws://webapi:8080%{REQUEST_URI} [P]
2130
ProxyPass wss://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
2231
ProxyPassReverse wss://webapi:8080/stomp/
2332
ProxyPass http://webapi:8080/stomp/ retry=0 acquire=3000 timeout=600 Keepalive=On
@@ -88,10 +97,17 @@
8897
AllowOverride All
8998
Require all granted
9099
RewriteEngine On
100+
101+
# Existing file or directory
91102
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
92103
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
93-
RewriteCond %{REQUEST_URI} !^/mobile?$
94104
RewriteRule ^ - [L]
105+
106+
# mobile UI
107+
RewriteCond %{REQUEST_URI} ^/mobile
108+
RewriteRule ^ /mobile/index.html [L]
109+
110+
# Fallback:
95111
RewriteRule ^ /index.html
96112
</Directory>
97113

0 commit comments

Comments
 (0)