-
Notifications
You must be signed in to change notification settings - Fork 1
/
apache-site.conf
50 lines (39 loc) · 1.33 KB
/
apache-site.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
ServerName 127.0.0.1
ErrorLog /dev/stdout
# https://stackoverflow.com/questions/2247352/set-remote-addr-to-x-forwarded-for-in-apache
RemoteIPHeader X-Forwarded-For
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" forwarded
WSGIPythonPath /srv/app
<VirtualHost *:80>
ServerName localhost
DocumentRoot /srv/app
CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout forwarded env=forwarded
ErrorLog /dev/stdout
LogLevel info
WSGIScriptAlias / /srv/app/pegasus_metrics.wsgi
<Directory /srv/app>
Options FollowSymLinks
AllowOverride all
</Directory>
# Require a password for the web UI
<Location />
AuthType basic
AuthName "Pegasus Metrics"
AuthUserFile /etc/apache2/apache.users
Require valid-user
</Location>
# Allow anyone to access /metrics with no password
<Location /metrics>
Allow from all
Satisfy any
</Location>
# Allow isi.edu to access /status with no password
<Location /status>
Deny from all
Allow from 127.0.0.1 172.16.0.0/12 10.0.0.0/8 128.9.0.0/16
Satisfy Any
</Location>
</VirtualHost>