Caddyfile
author ymh <ymh.work@gmail.com>
Fri, 05 Sep 2025 18:40:08 +0200
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
permissions -rw-r--r--
Add CLAUDE.md documentation and sync WordPress core files - Add comprehensive CLAUDE.md documentation file with project architecture, development setup, database operations, WordPress CLI usage, file sync procedures, and Mercurial commands - Update WordPress core files from wordpress/ to wp/ directory - Sync latest WordPress admin interface, includes, and core functionality - Update plugins: portfolio plugin with latest BWS framework and fancybox integration - Maintain custom configuration and theme files 🤖 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'

}