Questions tagged [caddyfile]

The term Caddyfile describes a text file that changes how an instance of the Caddy web server works.

Definition:

The Caddyfile is the configuration file of the web server.

It is similar in purpose to httpd.conf or nginx.conf.

The Caddyfile file can be named anything, but by default, Caddy will look for a file called Caddyfile in the current directory.

Example Usage:

example.com {
    root /www/example.com
}

sub.example.com {
    root /www/sub.example.com
    gzip
    log ../access.log
}

Important Links:

148 questions
0
votes
0 answers

Caddy Server - getting error for local domain - "Certificate is not valid"

I have installed caddy with the following docker compose so that I can use it as a reverse proxy for one of my wordpress installation. services: caddy: image: caddy:2.6.4-alpine container_name: caddy ports: - 80:80 -…
0
votes
2 answers

Caddyfile with multiple Single Page Applications

Let's say I have following file structure: - Caddyfile - files - app1 - index.html - app2 - index.html - app3 - index.html Where app1, app2 and app3 are Single Page Applications with clientside routing. I am using Caddy v2. I want…
Matija Sirk
  • 596
  • 2
  • 15
0
votes
0 answers

Vue app on server cannot communicate with DRF back-end on same VPS using caddy

It's my first time that I'm deploying Vue and DRF(Django rest frame work) app on production server. I used npm run build to build my Vue app as my front-end and I moves the dist folder to /var/www/html/frontend/. I'm calling my request using fetch…
Soroosh
  • 543
  • 1
  • 4
  • 21
0
votes
1 answer

Caddy server stop working with error "Stopped background certificate maintenance "

I am facing an issue with CaddyServer. It stop working. I find a message " Stopped background certificate maintenance " I run npm run build command in a nuxt2 project. then caddy automatically down. How: My Package.json code below: { "name":…
Al Emran
  • 46
  • 1
  • 6
0
votes
1 answer

Send 200 response in caddy reverse proxy before forwarding the request

Is it possible to send a 200 request to the server calling a reverse proxy, irrespective of whether the proxy server is available or not? The reason is when the calling server gets non-200 HTTP codes for some threshold value continuously, it will…
Asnim P Ansari
  • 1,932
  • 1
  • 18
  • 41
0
votes
0 answers

Parse Caddyfile with python

I would like to parse Caddyfile block and only return hosts. I am able to do it by reading the first line and search for { and then return hostname but when I have multiple hostname i am not sure how i can iterate through the text to find out other…
ehsan310
  • 1
  • 2
0
votes
0 answers

Caddy webserver: JWT OIDC e-mail whitelisting

Currently, I am trying to find out if the caddy webserver is able to implement some kind of e-mail whitelisting, based on the JWT token. Before reaching the frontend, which is served by caddy, an OIDC login is done by the user, provided by an…
Pridezen
  • 1
  • 3
0
votes
1 answer

Combining a PHP app and Caddy with two distinct Docker containers and FastCGI

I am currently trying to understand the functionality of Caddy and FastCGI. I have a setup that was working perfectly fine with NGINX and where I want to switch to Caddy to use the built-in SSL functionality. I am setting up 2 services in my Docker…
hoelska
  • 39
  • 6
0
votes
1 answer

How to protect caddy API endpoints? (configuration ones)

How do i protect configutation caddy server endpoints? https://caddyserver.com/docs/api it seems anyone can curl into the server and run the config api there. Is there any standard? Can it be done through some delegated auth?
Maielo
  • 692
  • 1
  • 6
  • 20
0
votes
1 answer

How do I use the host machine's PKI certificates in podman or docker from a caddy reverse proxy to HTTPS upstream services?

In caddy, when I disable auto_https and set the tls cert and key to those on the host machine, and have my upstream app(s) use the same certificates, I keep getting an error that says tls: bad certificate. This works in NGINX, and I have attempted…
Steve Storck
  • 793
  • 6
  • 25
0
votes
0 answers

-bash: xcaddy: command not found

I tried installing xcaddy with go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest. like stated at https://github.com/caddyserver/xcaddy But it does not even work, I am getting the error below: [root@vultrguest ~]# go install -x…
yeln
  • 462
  • 2
  • 10
  • 23
0
votes
0 answers

how to redirect post request to external url in caddy server

I am trying to redirect a post request to a external url but somehow caddy is converting my post request into get request.
0
votes
0 answers

In Caddy, can I disable sending 304 even when If-None-Match matches?

In Express you can app.disable('etag') is there anything similar in Caddy? I have tried : header { \-Etag \-Last-Modifier Cache-Control no-store } that makes Caddy not send the ETag header and it also makes browsers not send the If-None-Match:…
RubenLaguna
  • 21,435
  • 13
  • 113
  • 151
0
votes
0 answers

Caddy V2 Domain whitelististing?

I'm trying to figure out a way for Caddy v2 to whitelist certain domains, like something from NOIP, so that I can access my server anywhere without worrying about my IP changing. Trouble is I can't figure out how to get it to work with domains, it…
Rui
  • 31
  • 7
0
votes
0 answers

Caddy2 is returning "page can’t be found" if i put /api/* path in root of CaddyFile

i am very new with Caddy 2, I have two CaddyFile one of them work the other doesn't and the only difference they have is the path /api/* in root document. if any one can help with this would be great. the following CaddyFile works…