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
2
votes
2 answers

Caddy allow HTTP with Api Platform

I know this question has been asked many times: Caddy - How to disable https only for one domain Disable caddy ssl to enable a deploy to Cloud Run through Gitlab CI Caddy - Setting HTTPS on local domain How can I disable TLS when running from…
Lenny4
  • 1,215
  • 1
  • 14
  • 33
2
votes
1 answer

caddy - setting https to localhost on mac

I am using caddy v2.3.0 on mac If run caddy run i am getting following My Caddyfile { local_certs } demoCart.dev:443 { reverse_proxy http://localhost:3000 } If I run caddy validate it says Valid configuration When I am trying to access it…
nmanikiran
  • 2,866
  • 15
  • 19
2
votes
0 answers

reverse proxy websocket (paho) using caddy 2

i have an application that use PAHO. like this: this.client = new Client(environment.ZCA_MQTT, 8888, '', ''); The server use Node.js with nest.js (on port 10000) and Aedes const server = require('net').createServer(aedes.handle); //(port…
user3178486
  • 321
  • 6
  • 17
2
votes
2 answers

Serving maintenance page with 503 status code in Caddy

I'm trying to do something which seems fairly trivial to me, but can't seem to get it right with Caddy. I have the following site configured with Caddy: foo.com { tls { dns cloudflare ... } reverse_proxy /* http://proxy-foo } I'm now…
zsquare
  • 9,916
  • 6
  • 53
  • 87
2
votes
1 answer

CORS problems when using Caddy 2 and express

I've got a nodejs-express server running behind a Caddy 2 server as a reverse-proxy. Caddy is running on a docker with the following configuration in docker-compose caddy: image: caddy restart: always ports: - "443:443" -…
angrykoala
  • 3,774
  • 6
  • 30
  • 55
2
votes
0 answers

How can I deploy a Next.js app using Caddy and a subpath?

I'm currently doing an app with Next.js 8.0.3. Everything is fine in local. However I have some troubles when I deploy the app using Caddy. About my Next.js part I'm using a Custom server and to serve this server I'm doing this: next…
Aral Roca
  • 5,442
  • 8
  • 47
  • 78
2
votes
0 answers

Caddy server HTTPS redirect causes "too many redirects"

My web host already provides SSL configured on my domain so I want to use Caddy server to redirect HTTP traffic to HTTPS using the "Redirect only if the forwarded protocol is HTTP" example from the docs. The issue is that the browser is unable to…
Peter
  • 4,493
  • 6
  • 41
  • 64
2
votes
0 answers

Making nextcloud work on a prefixed path (using docker and caddy)

I'm trying to setup my own instance of nextcloud on my server but I'm running into a problem as I want nextcloud to be available under https://example.com/cloud/. Next cloud is running in a CoreOS virtual machine called let's say myvm. So this is…
chateau
  • 918
  • 11
  • 24
2
votes
1 answer

Change both http and https port on caddy

I'm having trouble setting a custom http and https port on caddy in my Caddyfile and could not find an answer using google and stackoverflow I can set a custom http port like this : http://example.com:2015 but I can't set a custom https…
Lastrosade
  • 45
  • 1
  • 5
2
votes
1 answer

Redirect Multiple Site Addresses/Labels (Including IP) to a Specific Site/Label in Caddyfile

I have a server running Caddy that can be reached under the domain rv2680.1blu.de and marleneschulz.info. Both DNS A records point to the IP address 178.254.7.175. I want to make sure Caddy always redirects the user to…
Yannic Hamann
  • 4,655
  • 32
  • 50
2
votes
1 answer

Caddy web server fastcgi with virtual hosts

I am trying to configure Caddy FastCGI with multiple virtual hosts. As far as I can tell the following Caddyfile should be working: gzip tls support@mydomain.com errors /var/log/caddy/error.log header / Strict-Transport-Security…
Justin
  • 42,716
  • 77
  • 201
  • 296
2
votes
1 answer

Crossbar caddy reverse proxy

How could I set a reverse proxy with caddy that speak with a crossbar router? I have a docker with a crossbar router that listen on localhost 8080, and I use caddy as a reverse proxy. Below the Caddyfile: `0.0.0.0:80 proxy /ws localhost:8080{ …
Fi3
  • 429
  • 6
  • 17
1
vote
1 answer

Copying files using Docker Compose

I am new to Docker Compose, and I was trying modify an example on serving multiple OpenAPI documents using Stoplight Prism. I have the file I want to copy under the directory /reference/Offers/Offers-APIs.v1.json, and in the project's root…
qli
  • 25
  • 3
1
vote
0 answers

Using the log directive in Caddy for both stdout and stderr

Reading through the Caddy docs for log directive, I am unsure how to modify the Caddyfile if we want to log both stdout and stderr. I tried starting Caddy without errors using the following Caddyfile but I am unsure how to test that it is actually…
gameveloster
  • 901
  • 1
  • 6
  • 18
1
vote
0 answers

RTSP proxying with Caddy

Problem I'm using MediaMTX to proxy an RTSP stream via a WebRTC endpoint. The MediaMTX server exposes a WebRTC endpoint on port 8889. I need to run the MediaMTX server on a VPS which is using Caddy as a reverse proxy and a static server to serve…
Abhijit
  • 468
  • 8
  • 22
1 2
3
9 10