]> ruin.nu Git - ndwebbie.git/blob - apache-conf.conf
Got wrong base url without the SSLEngine on statement
[ndwebbie.git] / apache-conf.conf
1 ### Section 3: Virtual Hosts
2 #
3 # VirtualHost: If you want to maintain multiple domains/hostnames on your
4 # machine you can setup VirtualHost containers for them. Most configurations
5 # use only name-based virtual hosts so the server doesn't need to worry about
6 # IP addresses. This is indicated by the asterisks in the directives below.
7 #
8 # Please see the documentation at 
9 # <URL:http://httpd.apache.org/docs-2.0/vhosts/>
10 # for further details before you try to setup virtual hosts.
11 #
12 # You may use the command line option '-S' to verify your virtual host
13 # configuration.
14
15
16 <VirtualHost *:80>
17         ServerName nd.ruin.nu
18
19         RewriteEngine On
20         RewriteCond %{HTTPS} !=on
21         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
22
23 </VirtualHost>
24
25 Listen 1337
26
27 <VirtualHost *:1337>
28         ServerName nd.ruin.nu
29
30         SSLEngine on
31         SSLCertificateFile /etc/apache2/ssl/nd.crt
32         SSLCertificateKeyFile /etc/apache2/ssl/nd.key
33
34         RewriteEngine On
35         RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
36
37 </VirtualHost>
38
39 NameVirtualHost *:443
40
41 <VirtualHost *:443>
42         ServerName nd.ruin.nu
43
44         ErrorLog /var/log/apache2/ndawn_error_log
45         <IfModule mod_log_config.c>
46                 #TransferLog logs/ndawn_access_log
47                 CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
48         </IfModule>
49
50         SSLEngine on
51         SSLCertificateFile /etc/apache2/ssl/server.crt
52         SSLCertificateKeyFile /etc/apache2/ssl/server.key
53
54
55         <IfModule setenvif_module>
56                 BrowserMatch ".*MSIE.*" \
57                         nokeepalive ssl-unclean-shutdown \
58                         downgrade-1.0 force-response-1.0
59         </IfModule>
60
61         Alias /static /var/www/ndawn/root/static
62         Alias /favicon.ico /var/www/ndawn/root/favicon.ico
63
64         FastCgiExternalServer /tmp/ndweb.fcgi -socket /tmp/ndweb.socket
65         Alias / /tmp/ndweb.fcgi/
66
67         <Location />
68                 Allow from all
69         </Location>
70
71         DeflateFilterNote ratio
72         <Location /static>
73                 SetHandler default-handler
74
75                 ExpiresActive On
76                 ExpiresDefault "access plus 1 week"
77                 #ExpiresByType text/css "access plus 1 week"
78                 #ExpiresByType application/javascript "access plus 1 week"
79                 #ExpiresByType image/png "access plus 1 week"
80
81                 AddOutputFilterByType DEFLATE text/html
82                 AddOutputFilterByType DEFLATE text/xml
83                 AddOutputFilterByType DEFLATE text/css
84                 AddOutputFilterByType DEFLATE application/javascript
85                 AddOutputFilterByType DEFLATE application/x-javascript
86                 AddOutputFilterByType DEFLATE application/xhtml+xml
87                 AddOutputFilterByType DEFLATE application/xml
88                 AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript
89         </Location>
90 </VirtualHost>