{
  "id": 16075641,
  "title": "Expose only share links of a private service with caddy",
  "url": "https://urgent.news/2026/10/22/expose-only-share-links-of-a-private-service-with-caddy",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-22T16:30:14.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://dataswamp.org/~solene/2026-10-21-caddy-forward-auth-public-share-links.html"
  },
  "original_language": "en",
  "account": "In self-hosted infrastructures, many services are only accessible via VPN. However, some services like Immich and Nextcloud offer the ability to share content with external users. To add an extra layer of security, the author wanted to create share links that could be clicked without requiring a VPN client or account. The usual approach would be to expose the entire service on the internet, which involves trusting various parts of the application. The author discovered a solution using the reverse proxy Caddy that allows only requests with valid share links and returns a 404 to all other requests. The process involves using Caddy's forward_auth directive, which sends a request to the service (auth server) to verify the link validity. If the response is a success, the real request is forwarded; otherwise, Caddy returns the auth server's response to the client. This method is used when most applications respond differently based on whether a share key is valid or not.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}