-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathhost.conf
76 lines (65 loc) · 2.49 KB
/
host.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
<VirtualHost *:443>
ServerName djbook.ru
ServerAlias www.djbook.ru
ServerAdmin ruslan.popov@gmail.com
WSGIScriptAlias / /home/django/djbookru/src/wsgi.py
WSGIDaemonProcess djbookru processes=5 maximum-requests=500 threads=20
WSGIProcessGroup djbookru
LogLevel debug
ErrorLog /home/django/logs/djbookru.error.log
CustomLog /home/django/logs/djbookru.access.log combined
ServerSignature On
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/djbook.ru/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/djbook.ru/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/djbook.ru/chain.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [7-9]" ssl-unclean-shutdown
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
Alias /admin/media/ "/home/django/djbookru/env/src/django/contrib/admin/media/"
Alias /static/ "/home/django/djbookru/src/public/static/"
Alias /media/ "/home/django/djbookru/src/public/media/"
Alias /rel1.4/ "/home/django/djbookru/docs/rel1.4/"
Alias /rel1.5/ "/home/django/djbookru/docs/rel1.5/"
Alias /rel1.6/ "/home/django/djbookru/docs/rel1.6/"
Alias /rel1.7/ "/home/django/djbookru/docs/rel1.7/"
Alias /rel1.8/ "/home/django/djbookru/docs/rel1.8/"
Alias /rel1.9/ "/home/django/djbookru/docs/rel1.9/"
<Directory "/">
SetEnvIfNoCase Host djbook\.ru VALID_HOST
Order Deny,Allow
Deny from All
Allow from env=VALID_HOST
</Directory>
<Directory "/home/django/djbookru/src">
Require all granted
</Directory>
<Directory "/home/django/djbookru/src/public/static">
Require all granted
</Directory>
<Directory "/home/django/djbookru/src/public/media">
Require all granted
</Directory>
<Directory "/home/django/djbookru/src/django/contrib/admin/media">
Require all granted
</Directory>
<Directory "/home/django/djbookru/docs">
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName djbook.ru
ServerAlias www.djbook.ru
ServerAdmin ruslan.popov@gmail.com
LogLevel debug
ErrorLog /home/django/logs/djbookru.error.log
CustomLog /home/django/logs/djbookru.access.log combined
Redirect / https://djbook.ru/
</VirtualHost>