Skip to content

Instantly share code, notes, and snippets.


Stewart Walter PhatKoala

View GitHub Profile
Ocramius / Caddyfile
Last active Jun 4, 2021
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
View Caddyfile
:80 {
root /serve
nurtext / .htaccess
Last active Jul 5, 2021
Tell apache we're on HTTPS if reverse proxy is serving the site using SSL
View .htaccess
# Let apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
# Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]