Caddyfile
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 21 48c4eec2b7e6
permissions -rw-r--r--
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>

{
       auto_https off
       debug
       admin off
#         log {
#                 level DEBUG
#                 output stdout
#         }
}

# enmi-conf.local {
        # root * /usr/share/caddy

#        php_fastcgi /wp/* fpm:9000 {
#                root /usr/share/caddy
#        }
    # file_server
        # file_server
# }

http://enmi-conf.127.0.0.1.nip.io:8080 {
    root * /var/www/html
    header -Server

    @site_staticfiles {
        path_regexp site_files ^/wp/([^/]+)?(/wp-.*)
    }

    rewrite @site_staticfiles /wp{re.site_files.2}

    # rewrite {
    #   regexp ^(/[^/]+)?(/wp-.*)
    #   to {2}
    # }

    # rewrite {
    #   regexp ^(/[^/]+)?(/.*\.php)
    #   to {2}
    # }

    # rewrite {
    #   if {path} not_match ^\/wp-admin
    #   to {path} {path}/ /index.php?{query}
    # }
    try_files {path} {path}/index.php /wp/index.php

    php_fastcgi fpm:9000 {
        index off
    }

    file_server
    
    encode gzip


    @disallowed {
        path /wp/xmlrpc.php
        path *.sql
        path /wp/wp-content/uploads/*.php
    }

    rewrite @disallowed '/wp/index.php'

}