Caddy doesnt serve Wordpress Site properly

1. Caddy version (caddy version):

v2.2.0

2. How I run Caddy:

a. System environment:

OS: Ubuntu 18.10
Host: vServer Hetzner.de
CPU: 4v Cores
RAM: 16GB
Run: systemd

b. Command:

service caddy start
service caddy status

c. Service/unit/compose file:

none

d. My complete Caddyfile or JSON config:

{
    experimental_http3
    http_port 8080
    https_port 8081
    email it@asvd.sasf.ch
}
asvd.sasf.ch {
    root * /var/www/asvd
    log {
        output file /var/log/caddy/asvd.sasf.ch.access.log {
        	roll_size 3MiB
	        roll_keep 5
	        roll_keep_for 48h
        }
        format console
    }

    basicauth /wp-content/uploads/forminator/* {
       xxxxx xxxxxx
    }
    
    encode gzip zstd
    php_fastcgi unix//run/php/php7.4-fpm.sock
   
    tls /etc/letsencrypt/live/asvd.sasf.ch/fullchain.pem /etc/letsencrypt/live/asvd.sasf.ch/privkey.pem {
    	protocols tls1.2 tls1.3
    }
}


3. The problem I’m having:

I’ve used Caddy for the first time on my Life Site.
It’s a Wordpress Site with a lot of Plugins and was migrated from Apache2.

The Strange thing is, when I switch to Caddy, the Site breaks and doesnt deliver all the Files anymore.
I’ve checked over, but there is nothing inside the Logs.

Has anybody a Idea why this is happening.
I’ve disabled all Cache Plugins, but the Site was still delivered broken.

Broken Site

4. Error messages and/or full log output:

Failed to decode downloaded font: <URL>
Failed to decode downloaded font: <URL>
Failed to decode downloaded font: <URL>
Failed to decode downloaded font: <URL>
Failed to decode downloaded font: <URL>
Failed to decode downloaded font: <URL>
VM56:3 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:3:7
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM59:3 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:3:13
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM61:2 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:2:4
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM64:2 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:2:1
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM68:3 Uncaught TypeError: $ is not a function
    at <anonymous>:3:6
    at <anonymous>:36:6
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM69:1 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:1:663
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM70:2 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:2:6
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM71:1 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:1:1
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
VM53:6 Uncaught ReferenceError: jQuery is not defined
    at revinit_revslider131 (<anonymous>:6:6)
    at HTMLDocument.<anonymous> (<anonymous>:57:236)
    at HTMLDocument.c (rocket-loader.min.js:1)
    at l (rocket-loader.min.js:1)
    at t.simulateStateBeforeDeferScriptsActivation (rocket-loader.min.js:1)
    at P (rocket-loader.min.js:1)
    at Object.callback (rocket-loader.min.js:1)
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)
jquery-ui-8a447043e625316b45f85f2ff05955ac.js:4 Uncaught ReferenceError: jQuery is not defined
    at jquery-ui-8a447043e625316b45f85f2ff05955ac.js:4
    at jquery-ui-8a447043e625316b45f85f2ff05955ac.js:4
(Index):1 Uncaught (in promise) oe
woocommerce-google-ac-a284fac531f07ceb8a11f17235adc877.js:25 Uncaught ReferenceError: jQuery is not defined
    at woocommerce-google-ac-a284fac531f07ceb8a11f17235adc877.js:25
yz-moderation-d381cba9d8df274c5b58fc2c43f2e8ff.js:7 Uncaught ReferenceError: jQuery is not defined
    at yz-moderation-d381cba9d8df274c5b58fc2c43f2e8ff.js:7
mec-fluent-layouts-31f951c23e4239f59f9c348f9b449ba2.js:1 Uncaught ReferenceError: jQuery is not defined
    at mec-fluent-layouts-31f951c23e4239f59f9c348f9b449ba2.js:1
uk-cookie-consent-js-7abbae0719cf77c1006ede69704219a0.js:7 Uncaught ReferenceError: jQuery is not defined
    at uk-cookie-consent-js-7abbae0719cf77c1006ede69704219a0.js:7
frontend-779e489b69538dfe6b1d4de95df5df17.js:1 Uncaught ReferenceError: jQuery is not defined
    at frontend-779e489b69538dfe6b1d4de95df5df17.js:1
cs.0ce70e6-6e5789f1e84e1a3dd6e6ad41f5b4b623.js:115 Uncaught TypeError: h(...) is not a function
    at Module.<anonymous> (cs.0ce70e6-6e5789f1e84e1a3dd6e6ad41f5b4b623.js:115)
    at n (cs.0ce70e6-6e5789f1e84e1a3dd6e6ad41f5b4b623.js:1)
    at cs.0ce70e6-6e5789f1e84e1a3dd6e6ad41f5b4b623.js:1
    at cs.0ce70e6-6e5789f1e84e1a3dd6e6ad41f5b4b623.js:1
x-e245ea1069524061c3a60110e133152b.js:1 Uncaught ReferenceError: jQuery is not defined
    at Module.<anonymous> (x-e245ea1069524061c3a60110e133152b.js:1)
    at n (x-e245ea1069524061c3a60110e133152b.js:1)
    at x-e245ea1069524061c3a60110e133152b.js:1
    at x-e245ea1069524061c3a60110e133152b.js:1
(Index):1 The resource https://fonts.gstatic.com/s/ptsans/v11/jizaRExUiTo99u79D0KExQ.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
(Index):1 The resource https://fonts.gstatic.com/s/poppins/v9/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
(Index):1 The resource https://fonts.gstatic.com/s/lato/v16/S6u9w4BMUTPHh6UVSwiPGQ.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
(Index):1 The resource https://fonts.gstatic.com/s/rubik/v9/iJWHBXyIfDnIV7Eyjmmd8WA.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

5. What I already tried:

Checked the Logs, it seems to be a delivery Issue with jQuery

6. Links to relevant resources:

ASVD Webpage

Howdy, Erkan! You’re just missing file_server in your Caddyfile. The file server isn’t enabled by default. You can see a working example of a Caddyfile that runs WordPress here.

2 Likes

That did the trick! Thanks @Mohammed90 :smiley:

1 Like

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