Hacker News new | ask | show | jobs
by kmeade 3442 days ago
I agree with both posts above me. While I normally prefer a GUI configuration facility, I wouldn't make the argument that IIS is particularly simpler than Apache.

Getting back to Caddy, configuration is so simple, a GUI would be overkill.

Here's an (entire) example of how to configure a reverse proxy in Caddy...

  proxy / 127.0.0.1:8080 {
    except /favicon.ico /robots.txt /assets /plainpages /staticstuff /test1
    proxy_header X-Forwarded-Proto {scheme}
  }
The "except" line is a list of files and directories that are statically served by Caddy.

All other content comes from a local server on port 8080.

The "proxy_header" line lets the 2nd server know when contents are being sent as secured (HTTPS)

Isn't that nice? I think so.

1 comments

I think you want header_upstream instead of proxy_header, at least in newer versions of Caddy, and the transparent[0] preset sets Host, X-Forwarded-For, and X-Forwarded-Proto for you!

  proxy / 127.0.0.1:8080 {
    except /favicon.ico /robots.txt /assets /plainpages /staticstuff /test1
    transparent
  }
0. https://caddyserver.com/docs/proxy
Thanks! I didn't notice transparent. I added the proxy_header based on documented requirements of the 2nd server.