-
Notifications
You must be signed in to change notification settings - Fork 1
/
app-httpd.conf
70 lines (61 loc) · 3.41 KB
/
app-httpd.conf
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<VirtualHost *:8080>
AllowEncodedSlashes NoDecode
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
DocumentRoot /opt/bitnami/apache/htdocs/gridexplore/
<Directory /opt/bitnami/apache/htdocs/gridexplore/>
<Files "index.html">
SetOutputFilter INCLUDES
</Files>
<FilesMatch "^(env\.json|idpSettings\.json)$">
# FileETag Digest for stable Etags accross loadbalanced servers for mounted files.
# "FileETag Digest" is acceptable here because these are only small files so
# having to read the full content of the file instead of just the filesystem
# metadata is not prohibitedly expensive. A better alternative would be to find
# a way to have stable filesystem metadata on all servers because:
# - accessing file system metadata is a lot less expensive.
# - contrary to apache httpd, nginx doesn't have an option to change the ETag
# generation method and always uses the filesystem metadata (size, mtime),
# so using "FileEtag Digest" locks us in with apache httpd.
# NOTE: this doesn't apply to files in the image (their filesystem metadata
# is the same because it's from the image), only to mounted files (bind mount
# or volume mount in docker compose, configmap in kubernetes)
# NOTE2: Because we use single file bind mounts for our files, the contents
# and filesystem metadata of our files fall out of sync between the host and
# the containers when the file is deleted or replaced (more precisely, as
# soon as the inode number of the file changes) (this can happen quite silently
# if your editor replaces the file when saving), but this means using Digest doesn't
# solve this issue. This is a known docker limitation: https://github.com/moby/moby/issues/6011
FileETag Digest
</FilesMatch>
Options +Includes
Header set Cache-Control "no-cache"
</Directory>
<Directory /opt/bitnami/apache/htdocs/gridexplore/static/>
# All files in this folder are public and have in their name
# the hash of their content, so cache them very aggressively
# as per recommended best practices
Header set Cache-Control "public, max-age=31536000, immutable"
</Directory>
<Location "/actuator/info">
SetHandler server-info
</Location>
AddModuleInfo mod_info.c 'Hostname: ${HOSTNAME}'
RewriteEngine On
RewriteMap remapbase "prg:/bin/sed -u -e 's;[^ ]* ;;' -e 's;[ ?].*;;' -e 's;[^/]*;..;g' -e 's;../..;;' -e 's/.//' -e 's;^$;.;'"
RewriteCond /opt/bitnami/apache/htdocs/gridexplore%{REQUEST_URI} -f [OR]
RewriteCond %{REQUEST_URI} ^/api/.* [OR]
RewriteCond %{REQUEST_URI} ^/ws/.*
RewriteRule ^ - [S=2]
RewriteRule ^ "${remapbase:%{THE_REQUEST}}" [DPI]
RewriteRule "^(.*)$" /index.html [E=BASE:$1,L]
SetEnvIf BASE ^$ BASE=.
ProxyRequests off
ProxyPassMatch "^/api/gateway/(.*)$" http://gateway/$1 nocanon
ProxyPassMatch "^/ws/gateway/(.*)$" ws://gateway/$1 nocanon
LimitRequestLine 64000
</VirtualHost>