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
1
vote
0 answers

Make caddy filter out a single file from the proxy directive

Caddy Version: Caddy 0.10.10 (non-commercial use only) I am using caddy as a reverse proxy for an ngnix server which happens to not have an index.html file in the web root. So I have instead setup my own index.html file in the hopefully appropriate…
Jfm Meyers
  • 123
  • 1
  • 12
1
vote
1 answer

Access restriction in caddy web server

My Caddyfile is pretty easy and looks like this: :80 tls off root /var/www gzip fastcgi / /var/run/php5-fpm.sock php Is it possible to restrict access to /var/www/secret, so http://localhost/secret/secretfile.txt is no longer accessible?
Benni
  • 778
  • 8
  • 22
1
vote
2 answers

How to serve Jenkins with Caddy?

I want to serve Jenkins CI with Caddy. Reading about Caddy "How to proxy from port to path" I have this Caddyfile: jenkins.example.com { proxy / http://localhost:8080 } Now I access Jenkins on port 8080 and set the Jenkins URL in Jenkins…
Lars Bilke
  • 4,940
  • 6
  • 45
  • 63
1
vote
1 answer

Laravel Valet not serving jpeg files with no extension

Laravel Valet serving jpeg files with no extension with wrong size and changed checksum of course. I'm posting information about an example file, the file with .0 at the end is downloaded through valet. $ls…
Ali Momen Sani
  • 840
  • 2
  • 11
  • 26
0
votes
0 answers

Is there a way with Caddy to proxy a certain domain pattern?

I am using Caddy as an entrypoint on my server where I have a backend that handles requests of clients. I may receive requests from domains like: assets.sport.com files.app.sport.com files-cdn.blabla.ch assets-cdn.hey.app.uk.co So I need a way to…
0
votes
0 answers

Why can't firefox automatically access the https of my domain that's a reverse proxy through caddy?

I'm trying to take a server I'm running and use a reverse proxy to use my domain to specifically access it. I have done this via caddy, which worked easily with the command caddy reverse-proxy --from website.com --to:8096. It gives no error and when…
Ryguy
  • 96
  • 8
0
votes
0 answers

What do @blocked from caddy config file?

@blocked not remote_ip 198.199.121.219 198.199.121.249 respond @blocked "Internal use only" 403 reverse_proxy http://localhost:8097 I can't understand from docs. What do @blocked in caddyfile? Why here is 2 @blocked? Could be list of…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
0
votes
0 answers

Caddy redirect "/" to "/file.pdf"

I want to redirect "subdomain.mydomain.com" to "subdomain.mydomain.com/file.pdf" using the Caddy reverse proxy docker image by lucaslorentz. How can I achieve this with my docker compose setup described in the following? My docker-compose.yml file…
Maludo
  • 1
  • 1
0
votes
0 answers

how to migrate from NGINX config to caddy file

I have a functioning setup with an nginx server hosting a site currently. I recently discovered caddy while following a guide for setting up a second site and wanted to migrate over to it. I've gotten it working to the point of both sites having…
Thranor
  • 393
  • 1
  • 4
  • 13
0
votes
0 answers

Change SSL Protocol error to custom error page in Caddy or either redirect to port 80

I am seeing SSL protocol error ( see pic below ) for domains which are not allowed in ask url for caddy. Rather then ugly browser error i would like to show custom error page or either force backup self signed certificates. In case that is not…
user3136348
  • 55
  • 1
  • 10
0
votes
0 answers

Serving ".html" files without the extension with Caddy

I have the following html/ directory and a Caddyfile: Caddyfile html/ ├── 404.html ├── 500.html ├── about.html ├── blog │   ├── one.html │   ├── two.html │   └── three.html ├── blog.html ├── home.html ├── projects.html └── static ├── css │  …
mart1n
  • 5,969
  • 5
  • 46
  • 83
0
votes
0 answers

Trouble Configuring Common Name for Wildcard Server Block in Caddy

i am on a path to migrate away from nginx. historically - we have a *.domain.com wildcard certificate (without autorenew, letsentencrypt and others) the caddy2 block looks like this.: *.domain.com { tls /keys/server.crt /keys/server.key …
Helmut Januschka
  • 1,578
  • 3
  • 16
  • 34
0
votes
0 answers

Reverse proxy all ports in docker by caddy

I want to make a docker container in which a reverse proxy to all applications will be performed using caddy. Unfortunately, everything is simple, I use the following code in caddyfile: rewrite /tools/vscode /tools/vscode/ handle_path…
Andrew
  • 101
0
votes
0 answers

Having trouble setting up caddy reverse proxy for a Gitea server

I've been having trouble mapping my local Gitea server to my subdomain git.neroshop.org for weeks now. I've tried nginx and caddy but I haven't had any success so far. Right now I'm trying to use caddy but I keep getting this error. Any help would…
0
votes
1 answer

How to protect direct ip access in caddy

I've a subdomain: api.example.com And I've a caddyfile that use a reverse proxy to redirect to my api backend: api.example.com { basicauth { user my_hashed_password } reverse_proxy localhost:8000 } As you can see I protect the access of…
obchardon
  • 10,614
  • 1
  • 17
  • 33