-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpd-vhosts.conf
116 lines (92 loc) · 4.55 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Qlik Sense Reverse Proxy configuration for header authentication
#
# Qlik Sense test Header configuration:
# - Create a new Virtual Proxy with Header authentication using a Static User Directory. EX: QVUSER as the Header name
# - Add the Reverse Proxy FQDN/Server Name and IP address to whitelist of virtual proxy
#
#Put the IP Address OR FQDN/Server Name of Qlik Sense Server as SENSE_SERVER_1 and SENSE_SERVER_2. EX: qlikserver1.domain.local
#Put the IP Address OR FQDN/Server Name of Reverse Proxy as LOCAL_ADDR. EX: 172.16.16.102
#Put the FQDN/Server Name of Reverse Proxy as APACHE_SERVER. EX: qlikserver3.domain.local
#Put the Virtual Proxy prefix as VIRTUAL_PROXY - EX: header
#Put the desired name for the Balancer configuration as BALANCER_NAME -EX: balancer
Define SENSE_SERVER_1 qlikserver1.domain.local
Define SENSE_SERVER_2 qlikserver2.domain.local
Define APACHE_SERVER qlikserver3.domain.local
Define LOCAL_ADDR 172.16.16.102
Define VIRTUAL_PROXY header
Define VIRTUAL_PROXY_1 adfsapache
Define BALANCER_NAME balancer
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot "${SRVROOT}/htdocs"
ServerName ${LOCAL_ADDR}:443
ServerAlias ${APACHE_SERVER}
SSLProxyEngine on
SSLEngine on
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
#Location of the SSL certificate used for this virtual host in their .crt and .key file format
SSLCertificateFile "${SRVROOT}/conf/ssl/QlikServer3Certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/conf/ssl/QlikServer3Certificate.key"
ProxyRequests Off
ProxyPreserveHost On
KeepAlive On
RewriteEngine On
# If it is a websocket request forward as websocket traffic
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule ^/(.*) balancer://wss-${BALANCER_NAME}/$1 [P,L]
<Proxy *>
Require all granted
</Proxy>
#Adding a cookie with the RouteID of a server to maintain Sticky Sessions.
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
#Balancer configuration and load balancing methods defined for SSL / HTTPS and WSS / WebSocket traffic
<Proxy balancer://${BALANCER_NAME}>
BalancerMember "https://${SENSE_SERVER_1}:443" route=1
BalancerMember "https://${SENSE_SERVER_2}:443" route=2
ProxySet lbmethod=byrequests
ProxySet stickysession=ROUTEID
</Proxy>
<Proxy balancer://wss-${BALANCER_NAME}>
BalancerMember "wss://${SENSE_SERVER_1}:443" route=1
BalancerMember "wss://${SENSE_SERVER_2}:443" route=2
ProxySet lbmethod=byrequests
ProxySet stickysession=ROUTEID
</Proxy>
# Uncomment to open up all URLs from the Reverse Proxy / Load Balancer to Qlik Sense
# ProxyPass "/" "balancer://${BALANCER_NAME}/"
# ProxyPassReverse "/" "balancer://${BALANCER_NAME}/"
# Can point to certain Virtual Proxies instead of opening up the environment. EX: "/header"
# Note: If an ending slash is used, "/header/" "balancer://${BALANCER_NAME}/${VIRTUAL_PROXY}/" it needs to be in the URL when accessing through the browser
# EX: "https://qlikserver3.domain.local/header/ - will work / https://qlikserver3.domain.local/header - will not work"
ProxyPass "/${VIRTUAL_PROXY}" "balancer://${BALANCER_NAME}/${VIRTUAL_PROXY}"
ProxyPassReverse "/${VIRTUAL_PROXY}" "balancer://${BALANCER_NAME}/${VIRTUAL_PROXY}"
ProxyPass "/${VIRTUAL_PROXY_1}" "balancer://${BALANCER_NAME}/${VIRTUAL_PROXY_1}"
ProxyPassReverse "/${VIRTUAL_PROXY_1}" "balancer://${BALANCER_NAME}/${VIRTUAL_PROXY_1}"
# Balancer configuration page. EX: https://qlikserver3.domain.local/balancer-manager
<Location "/balancer-manager">
SetHandler balancer-manager
Require host ${APACHE_SERVER}
</Location>
# Server status page. EX: https://qlikserver3.domain.local/server-status
<Location /server-status>
SetHandler server-status
Require host ${APACHE_SERVER}
</Location>
</Virtualhost>