Caddyfile
changeset 19 3d72ae0968f4
child 21 48c4eec2b7e6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Caddyfile	Tue Sep 27 16:37:53 2022 +0200
@@ -0,0 +1,65 @@
+{
+       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.local: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'
+
+}
+