Listen 80
Listen 443
+# Server name
+ServerName localhost
+
# Server admin
ServerAdmin root@localhost
# Allow file send
EnableSendfile on
+# Set timeout
+Timeout 600
+
# Set document root
DocumentRoot "/var/www/html"
SSLSessionCache shmcb:/run/ihttpd/ssl_scache(512000)
SSLProtocol all -SSLv3
-# Redirect to https
+# Enable rewrite
RewriteEngine On
+
+# Redirect to https
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
+# Redirect unexisting documents to script
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule .* /index.bin [L]
+
# SSL vhost
<VirtualHost *:443>
- ServerName localhost
+ # Enable ssl
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ihttpd.pem
SSLCertificateKeyFile /etc/pki/tls/private/ihttpd.pem
+
+ # Inherit rewrite config
+ RewriteEngine On
+ RewriteOptions Inherit
+
+ # Set custom log
CustomLog "/run/ihttpd/log/https.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>