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
1 answer

Get user-id from Caddy and CherryPy basic-auth

I'm using Caddy as a reverse proxy, feeding a web app on CherryPy. Caddy is handling basic-auth, and I would like to pass the username to the CherryPy app. I've modified my Caddyfile like this: my.example.com { redir /data_tools /data_tools/ …
user1209675
  • 296
  • 7
  • 18
0
votes
1 answer

How to get correct $_SERVER['SERVER_PORT'] and $_SERVER['HTTPS'] values in php when using reverse_proxy with caddy in docker

I am trying to move my local testing site into a docker container for ease of use when changing between machines. I am using caddy within docker so that I can connect to the locally hosted site via https. It is all working well except for the fact…
Henry Howeson
  • 677
  • 8
  • 18
0
votes
0 answers

Caddy not redirecting https:// to https://www

My Caddy config does not redirect https://example.com to https://www.example.com However, if I just type http://example.com, it does the redirection correctly to https://www.example.com Caddy file: { debug email…
Oras
  • 1,036
  • 1
  • 12
  • 18
0
votes
1 answer

Caddy Server Logs Outputting to Azure Log Analytics

We are running Caddy 2.4.6 in a Linux VMs and are trying to get the logs output into Azure Log Analytics via rsyslog. I have added the facilities for all log levels for syslog, user, local0 through local7. And confirmed this via…
bla9x
  • 469
  • 7
  • 17
0
votes
1 answer

Caddyfile - How to run multiple listeners under the same server?

I am newbie to Caddy. I have a system that has 2 servers, backend and frontend. The frontend is a React app. I want to use reverse proxies in caddy to direct requests coming from outside to my servers. If I want to run only one server, let's say the…
philippos
  • 1,142
  • 5
  • 20
  • 41
0
votes
1 answer

How to serve both an API and a UI on the same domain using caddy

I'm trying to get a UI and an API both on the same domain using caddy. So far I have tried these two approaches: foo.local { reverse_proxy /api/* localhost:4000 root * /bar try_files {path} /index.html file_server } In this…
clev
  • 43
  • 1
  • 3
0
votes
1 answer

Caddy file server with a route

I run caddy with docker. I have my website loaded to /etc/license inside the docker container. When I serve from the root, with the following Caddyfile: $MYDOMAIN { root * /etc/license file_server } It works as expected, my website loads when…
RailTracer
  • 101
  • 1
  • 7
0
votes
0 answers

Caddy isn't working and full connection is working fine

So Caddy was running normally until I wrote the command caddy run, and now it is failing ● caddy.service - Caddy Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled) Drop-In:…
0
votes
1 answer

Caddy on LAN only

I am trying to setup a reverse proxy with Caddy, I also want to use subdomains to point to my different services, so I bought a domain but the domain can only point to an ip-address, and my routers ip-address is not static so to solve that I…
0
votes
1 answer

Not able to configure Caddy server to use TLS with my domain name

I already have pointed domain's A/AAAA records point to my server's IP address and I do see Caddy home page when I put my server's IP address in the browser but not with domain name. Not sure if my Caddyfile changes are even getting reloaded. Hit in…
Nital
  • 5,784
  • 26
  • 103
  • 195
0
votes
1 answer

How can I use Caddy to proxy for another site?

I have a service on foo.bar.com and I need to move it to foo.example.com. To give stragglers a chance to catch up I was hoping to put Caddy on on the server dealing with foo.bar.com and have it proxy for foo.example.com. Can't get even a basic…
Jason Leach
  • 3,889
  • 7
  • 37
  • 54
0
votes
1 answer

Can not configure the new dunglas/mercure image

Problem: Dunglas Mercure just upgraded this week, and has completly change, it now use a caddy web serveur solution instead of a built-in web serveur, it seems to be very cool, but now, i can not configure my dunglas/mercure image…
0
votes
1 answer

MIME types error when using URL rewriting on Springboot server and Angular app

I am working on a SpringBoot application with 2 Angular app frontend that are located as such : Springboot app : src -> main -> java Angular app 1 (fo) : src -> main -> resources -> public -> fo Angular app 2 (bo) : src -> main -> resources ->…
Natty
  • 497
  • 1
  • 11
  • 23
0
votes
1 answer

How to enable TLS 1.1 inside a Caddyfile with Caddy 2

I have this current Caddyfile configuration: example.com { reverse_proxy localhost:3000 } Using Caddy 2, how can I enable TLS 1.1 or even TLS 1.0 within this configuration? I already saw that there is the tls configuration but I didn't…
Nathanael Demacon
  • 1,169
  • 7
  • 19
0
votes
1 answer

Mystifying redirects when serving Wordpress site on Nginx behind a Caddy reverse proxy

I am self-hosting a bunch of services that are hosted in various VMs/containers and am using a Caddy v1 server as a reverse proxy to access them through various subdomains. I recently started a couple of Wordpress sites that are hosted on a…
KaziJehangir
  • 295
  • 1
  • 3
  • 9