This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 681
/
mozilla-kuma-apache.conf
69 lines (56 loc) · 2.36 KB
/
mozilla-kuma-apache.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
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
# Covering all pre-bug-702988 past-known server aliases
ServerName developer-local.allizom.org
ServerAlias developer-kumadev.mozilla.org
ServerAlias developer-mdndev.mozilla.org
ServerAlias developer-dev.mozilla.org
ServerAlias mdn-local.mozillademos.org
DirectoryIndex index.html
Options -Indexes
RewriteEngine On
DocumentRoot /var/www
<Directory "/var/www">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Alias /media/ "/vagrant/media/"
Alias /static/ "/vagrant/static/"
Alias /uploads/ "/home/vagrant/uploads/"
Alias /admin-media/ "/vagrant/vendor/src/django/django/contrib/admin/media/"
# This runs the python app through mod_wsgi
# More like prod, but requires a `touch /vagrant/wsgi/*` to refresh code
#WSGIDaemonProcess kuma processes=8 threads=1 maximum-requests=8 user=vagrant group=vagrant
#WSGIProcessGroup kuma
#WSGIScriptAlias /mwsgi "/vagrant/wsgi/kuma.wsgi"
# This runs the python app from port 8000, which must be started manually
# eg. /home/vagrant/kuma-venv/bin/python /vagrant/manage.py runserver 0.0.0.0:8000
TimeOut 600
ProxyTimeout 600
ProxyPass /mwsgi http://localhost:8000 retry=1
ProxyPassReverse /mwsgi http://localhost:8000
# Proxy to reach elasticsearch
ProxyPass /elastic http://localhost:9200
ProxyPassReverse /elastic http://localhost:9200
# Proxy any requests for non-existent resources under /media/uploads to the
# production site. That way, we don't need an export of files from prod for
# references in a DB export from prod.
#
# FIXME: This is broken right now, because production forbids any referers
# not from production for media assets. A referer-blocker addon might work
SSLProxyEngine on
RewriteCond /vagrant%{REQUEST_FILENAME} !-f
RewriteCond /vagrant%{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /media/uploads/
RewriteRule ^/media/uploads/(.*)$ https://developer.mozilla.org/media/uploads/$1 [P,L]
</VirtualHost>