]> git.rocketbowman.com Git - srv-deb.git/commitdiff
add SSL redirect to config
authorKyle Bowman <kyle+github@rocketbowman.com>
Sat, 11 Oct 2025 22:42:31 +0000 (18:42 -0400)
committerKyle Bowman <kyle+github@rocketbowman.com>
Sat, 11 Oct 2025 22:42:31 +0000 (18:42 -0400)
deb-repo.conf

index ce2372be0f25ec2a41896a23c78dd71a6812e0d5..d7d5739c436514b7c2b22e07ed6570ae1771c8ae 100644 (file)
@@ -1,13 +1,32 @@
 <VirtualHost *:80>
-    ServerName SERVER_NAME_PLACEHOLDER
-    DocumentRoot /path/to/STORE_PLACEHOLDER
+    ServerName YOUR_SERVER
+
+    # Redirect root requests to the https version
+    Redirect permanent / https://YOUR_SERVER
+    
+    # If there's some additional stuff in the URI, send that too
+    RewriteEngine on
+    RewriteCond %{SERVER_NAME} =YOUR_SERVER
+    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
+</VirtualHost>
+
+<VirtualHost *:443>
+    ServerName YOUR_SERVER
+    DocumentRoot /path/to/parent/of/dists
  
-    <Directory /path/to/STORE_PLACEHOLDER>
+    <Directory /path/to/parent/of/dists>
         Options Indexes FollowSymLinks
         AllowOverride None
         Require all granted
-    </Directory>
+    </Directory>    
+
+    # Use SSL/TLS Encryption - you may have to regenerate certificate to add new
+    # subdomain if you added one to your server
+    SSLEngine on  
+    Include /etc/letsencrypt/options-ssl-apache.conf  
+    SSLCertificateFile /path/to/fullchain/cert
+    SSLCertificateKeyFile /path/to/private/cert
     
-    ErrorLog ${APACHE_LOG_DIR}/debian-repo-error.log
+    ErrorLog ${APACHE_LOG_DIR}/debian-repo-error.log  
     CustomLog ${APACHE_LOG_DIR}/debian-repo-access.log combined
-</VirtualHost>
\ No newline at end of file
+</VirtualHost>