Skip to content
Snippets Groups Projects

apache2 vhost 80 to 443 redirect, single domain

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Dennis Ahrens
    Edited
    vhost.conf 608 B
    <VirtualHost *:80>
      ServerName forschungscluster.hs-hannover.de
      # ServerAlias foo.example.com
      ServerAdmin dennis.ahrens@hs-hannover.de
      Redirect permanent / https://forschungscluster.hs-hannover.de
    </VirtualHost>
    
    <VirtualHost _default_:443>
      ServerName forschungscluster.hs-hannover.de
      # ServerAlias foo.example.com
      DocumentRoot /var/www/forschungscluster
      
      SSLEngine On
    
      SSLHonorCipherOrder On
      SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
    
      SSLProtocol All -SSLv2 -SSLv3  
    
      SSLCertificateFile /path/to/cert.pem
      SSLCertificateKeyFile /path/to/cert.key
    </VirtualHost>
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment