Converting nginx file fastcgi options

1. Caddy version (caddy version):


2. How I run Caddy:

sudo caddy run

a. System environment:

ubuntu 18.04

b. Command:

sudo caddy run

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config:, {
        root * /var/www/bench/bench/public

        #errors /var/log/caddy/error.log
        encode zstd gzip
        # Add trailing slash for directory requests
        @canonicalPath {
                file {
                        try_files {path}/index.php
                not path */
        redir @canonicalPath {path}/ 308

        # If the requested file does not exist, try index files
        @indexFiles {
                file {
                        try_files {path} {path}/index.php index.php
                        split_path .php
        rewrite @indexFiles {http.matchers.file.relative}
# php_fastcgi unix:/run/php/php7.3-fpm.sock
        # Proxy PHP files to the FastCGI responder
        @phpFiles {
                path *.php
        reverse_proxy @phpFiles unix//run/php/php7.3-fpm.sock {
                transport fastcgi {
                        split .php

  log {
    output file access_dom1.log
    format single_field common_log

3. The problem I’m having:

I’ve been converting my nginx conf to caddy.

But how would I convert these fastcgi options?
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;

and the following
location ~ /.(?!well-known).* {
deny all;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

A few of them can be customized using the JSON config: Modules - Caddy Documentation

Most of them are pretty granular knobs though, most apps won’t need to set them at all.

This sounds like a job for @Whitestrake :smile:


rewrite /.well-known /.well-known/
respond /.well-known/* 403
1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.