Hello and thanks for this project,
I really like it and it replaced Caddy for me.
I’m trying to figure out on how to use Kanidm which forces HTTPS on localhost.
With Caddy this was the solution:
id.example.com {
reverse_proxy https://10.0.0.2:8443 {
header_up X-Real-IP {from 192.168.1.2/32}
transport http {
tls
tls_server_name id.example.com
}
}
}
While running certbot on the local machine to use automatic certs.
ferron.conf:
id.example.com {
tls false
proxy http://10.0.0.2:8443 {
+X-Client-IP "{{remote.ip}}"
}
}
With my ferron.conf I run in to a 502 error with this output in the logs:
Reverse proxy: Bad gateway — upstream: http://10.0.0.2:8443: Connect failed: TCP connect failed: Connection refused (os error 111)
How would someone craft a ferron.conf to run applications that only accept HTTPS?
Here is my full ferron.conf I gladly appreciate it, if you have any further recommendations:
(match …_path doesn’t seem to work)
{
runtime {
io_uring
cpu_affinity 0 # Singlecore
}
match sensitive_path {
request.uri.path ~ r"^/(?:\.|wp-config\.php|\.env)"
}
match admin_path {
request.uri.path ~ r"/wp-login\.php|/admin(?:/|$)"
}
rate_limit {
rate 50
burst 100
key remote_address
}
client_ip_from_header x-forwarded-for {
trusted_proxy "10.0.0.0/8"
trusted_proxy "192.168.0.0/16"
}
}
*.example.com {
if sensitive_path {
status 403 {
body "Access denied"
}
}
compressed
precompressed
dynamic_compressed
tls {
provider acme
challenge dns-01
dns {
provider desec
auth_token "{{env.auth_token}}"
}
}
}
www.example.com {
https_redirect false
status 301 {
location "https://example.com{{request.uri}}"
}
}
example.com {
proxy 10.0.0.2:44444
if admin_path {
basic_auth {
realm "Admin Area"
users {
<user> "$2b.."
}
}
}
}
bw.example.com {
proxy 10.0.0.2:45622
}
cal.example.com {
# @wellknown expression path_regexp('/.well-known/(card|cal)dav')
# redir @wellknown /dav.php/ permanent
proxy 10.0.0.2:8133
}
fg.example.com {
proxy http://10.0.0.2:3000
}
id.example.com {
tls false
proxy http://10.0.0.2:8443 {
+X-Client-IP "{{remote.ip}}"
}
}
