-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache-config.example
More file actions
46 lines (35 loc) · 1.48 KB
/
apache-config.example
File metadata and controls
46 lines (35 loc) · 1.48 KB
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
# Redirect all plain HTTP traffic to HTTPS.
<VirtualHost *:80>
ServerName pptiny.twistedslinky.org
Redirect permanent / https://pptiny.twistedslinky.org/
</VirtualHost>
<VirtualHost *:443>
ServerName pptiny.twistedslinky.org
DocumentRoot /var/www/pptiny
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/pptiny.twistedslinky.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/pptiny.twistedslinky.org/privkey.pem
# PPTINY_HOST pins the host used when building short_url responses so it
# isn't reflected from a client-supplied Host header.
SetEnv PPTINY_HOST pptiny.twistedslinky.org
WSGIDaemonProcess tinyurl user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/pptiny/wsgi.py
<Directory /var/www/pptiny>
Options -Indexes
# Outer cap on request bodies; app also caps at 4096 bytes.
LimitRequestBody 65536
<Limit GET HEAD>
Require all granted
</Limit>
# Any write-ish method (POST, DELETE, PUT, PATCH, WebDAV verbs) is
# restricted to localhost. The app only implements POST and DELETE,
# but belt-and-suspenders at the Apache layer is cheap.
<LimitExcept GET HEAD>
Require ip 127.0.0.1 ::1
</LimitExcept>
WSGIProcessGroup tinyurl
WSGIApplicationGroup %{GLOBAL}
</Directory>
ErrorLog ${APACHE_LOG_DIR}/pptiny_error.log
CustomLog ${APACHE_LOG_DIR}/pptiny_access.log combined
</VirtualHost>