NameVirtualHost {YOUR_IP}:443
<VirtualHost {YOUR_IP}:443>
    
    ServerAdmin     webmaster@{YOUR_SERVER-DNS-NAME}
    DocumentRoot    /var/www/
    
    ServerName      *
    
    CustomLog       /var/log/apache2/{YOUR_SERVER-DNS-NAME}-ssl.log combined
    
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/apache.pem

    RewriteEngine on
    
    #optional
    RewriteLog /var/log/apache2/proxy_rewrite.log
    RewriteLogLevel 1
    
    #this is not an open proxy
    RewriteRule ^(http|https)://.* - [F]

    #rewriting the url an send to proxy
    RewriteRule ^/(.*)$ http://%{HTTP_HOST}/$1 [P]
    
    #forgett all other requests
    RewriteRule ^.*$ - [F]

</VirtualHost>

