forked from Normation/rudder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rudder-vhost.conf
33 lines (24 loc) · 930 Bytes
/
rudder-vhost.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
<VirtualHost *:80>
ServerAdmin webmaster@localhost
# Rudder webapp
RewriteEngine on
# Rule 1 - If hitting the server root, redirect to Rudder
RewriteRule ^/$ /rudder [R]
# Rule 2 - If we are not currently connected via HTTP/S
RewriteCond %{HTTPS} !=on
# Rule 2 - Don't use HTTP/S for these URLs to avoid breaking the compatibility for cURL
# clients (especially in Techniques)
RewriteCond %{REQUEST_URI} !^/uuid
RewriteCond %{REQUEST_URI} !^/inventories/?
RewriteCond %{REQUEST_URI} !^/inventory-updates/?
RewriteCond %{REQUEST_URI} !^/api/?
# Rule 2 - Restrict redirection to Rudder webapp
RewriteCond %{REQUEST_URI} ^/rudder/?
# Rule 2 - Redirect to HTTP/S
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R]
Include /opt/rudder/etc/rudder-apache-common.conf
# Logs
ErrorLog /var/log/rudder/apache2/error.log
LogLevel warn
CustomLog /var/log/rudder/apache2/access.log combined
</VirtualHost>