# Gitea vhost $HTTP["host"] == "git.example.com" { include "snippets/example.com-certs.conf" $HTTP["scheme"] == "http" { # but not the letsencrypt webroot ... $HTTP["url"] =~ "^/\.well-known" { alias.url += ( "/.well-known/" => "/var/www/dehydrated/.well-known/" ) } # Normal redirect to HTTPS while we get HTTP request $HTTP["url"] !~ "^/\.well-known" { $HTTP["host"] =~ ".*" { url.redirect = ( ".*" => "https://%0$0" ) } } } # Finally HTTP request, lets proxy it as we need $HTTP["scheme"] == "https" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 3000 ) ) ) } }