-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpd-vhosts.conf
94 lines (73 loc) · 2.78 KB
/
httpd-vhosts.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Listen 0.0.0.0:443
##
## SSL Global Context
##
## All SSL configuration in this context applies both to
## the main server and all SSL-enabled virtual hosts.
##
#
# Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLHonorCipherOrder on
SSLProtocol all
SSLProxyProtocol all
SSLPassPhraseDialog builtin
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLSessionCache "shmcb:${HTTPD_PREFIX}/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
LogLevel error proxy:trace2
Mutex "file:${HTTPD_PREFIX}/logs/ssl_mutex"
<VirtualHost *:80>
ServerName localhost
RewriteEngine On
ProxyPreserveHost On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^(?:)?(.+)$ [NC]
RewriteRule ^ https://%{SERVER_NAME}/picsureui/ [L,NE,R=301]
</VirtualHost>
<VirtualHost _default_:443>
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLCertificateFile "${HTTPD_PREFIX}/cert/server.crt"
SSLCertificateKeyFile "${HTTPD_PREFIX}/cert/server.key"
SSLCertificateChainFile "${HTTPD_PREFIX}/cert/server.chain"
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"
RewriteEngine On
<Location /jupyterhub>
ProxyPass http://jupyterhub:8000/jupyterhub
ProxyPassReverse http://jupyterhub:8000/jupyterhub
</Location>
<LocationMatch "/jupyterhub/(user/[^/]*)/(api/kernels/[^/]+/channels|terminals/websocket)(.*)">
ProxyPassMatch ws://jupyterhub:8000/jupyterhub/$1/$2$3
ProxyPassReverse ws://jupyterhub:8000/jupyterhub/$1/$2$3
</LocationMatch>
<LocationMatch "^/picsure/(.*)$">
ProxyPassMatch https://${BACKEND_HOST}/picsure/$1 disablereuse=On
ProxyPassReverse https://${BACKEND_HOST}/picsure/$1
</LocationMatch>
<LocationMatch "^/psama/(.*)$">
ProxyPassMatch https://${BACKEND_HOST}/psama/$1 disablereuse=On
ProxyPassReverse https://${BACKEND_HOST}/psama/$1
</LocationMatch>
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule /picsureui/(.*) /picsureui/index.html [C]
RewriteRule ^/static/(.*)$ /static/$1 [L]
RewriteRule ^/psamaui/(.*)$ /picsureui/index.html [C]
RedirectMatch ^/$ /picsureui/
ErrorDocument 404 /picsureui/index.html
DocumentRoot "${HTTPD_PREFIX}/htdocs"
ErrorLog "${HTTPD_PREFIX}/logs/error_log"
TransferLog "${HTTPD_PREFIX}/logs/access_log"
CustomLog "${HTTPD_PREFIX}/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>