forked from zonemaster/zonemaster-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zonemaster.conf-example
50 lines (38 loc) · 1.67 KB
/
zonemaster.conf-example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<VirtualHost *:80>
DocumentRoot /var/www/html/zonemaster-web-gui/dist
DirectoryIndex index.html
ServerAdmin [email protected]
# Define base url for rewriting, needs a trailing slash.
Define BASE_URL "/"
# Uncomment to use Zonemaster from a different base url
# Don't forget to also update the BASE_URL definition above and to also
# change the base href in the index.html files.
# Do not add a trailing slash here.
#Alias "/zonemaster" "/var/www/html/zonemaster-web-gui/dist"
<Directory "/var/www/html/zonemaster-web-gui/dist">
Options MultiViews FollowSymlinks Includes
Require all granted
RewriteEngine on
RewriteBase ${BASE_URL}
RewriteRule ^../index\.html$ - [L]
# Rewrite /<LANG>/assets/ to /assets to share the assets directory
RewriteRule ^(.+)/(assets/.+) $2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule "^(da|en|es|fi|fr|nb|sv)" $1/index.html [L]
# Rewrite path to new language scheme using preferred locale
RewriteCond $1 "!^(da|en|es|fi|fr|nb|sv|assets)"
RewriteCond %{HTTP:Accept-Language} ^(da|en|es|fi|fr|nb|sv) [NC]
RewriteRule ^(.+)$ %1/index.html [L]
# Redirect user based on prefered locale
RewriteCond %{HTTP:Accept-Language} ^(da|en|es|fi|fr|nb|sv) [NC]
RewriteRule ^$ ${BASE_URL}%1/ [R,L]
# Default locale
RewriteRule ^$ ${BASE_URL}en/ [R,L]
</Directory>
ProxyPass ${BASE_URL}api http://localhost:5000/
ProxyPassReverse ${BASE_URL}api http://localhost:5000/
ProxyPreserveHost On
ErrorLog /var/log/zonemaster/zonemaster-web-gui-error.log
CustomLog /var/log/zonemaster/zonemaster-web-gui-access_log common
</VirtualHost>