[ad_1]
hello, can i have some help configuring this plugin for Caddy webserver?
so far i got:
wordpress.website.com {
root * /home/deploy/wordpress.website.com
encode gzip
file_server
php_fastcgi unix//run/php/php8.2-fpm.sock
@disallowed {
path /xmlrpc.php
path *.sql
path /wp-content/uploads/*.php
}
# Protect WooCommerce upload folder from being accessed directly.
# You may want to change this config if you are using "X-Accel-Redirect/X-Sendfile" or "Force Downloads" method for downloadable products.
# Place this config towards the end of the "route" block in your Caddyfile.
@woocommerce_uploads {
path_regexp wp-content/uploads/woocommerce_uploads/.*
}
handle @woocommerce_uploads {
header {
X-Accel-Redirect ""
}
respond 403 "Access denied"
}
log {
output file /var/log/caddy/wordpress.website.com.log {
roll_size 1gb
roll_keep 5
roll_keep_for 720h
format console
}
}
rewrite @disallowed '/index.php'
#################################
# route /wp-content/*.(jpg|jpeg|png|gif|webp) {
# @ext_avif {
# not {
# header Accept *image/avif*
# }
# }
# @ext_webp {
# not {
# header Accept *image/webp*
# }
# }
# header Vary Accept
#
# rewrite * /wp-content/uploads-webpc/{path}.{ext}{ext_avif}{ext_webp}
#
# handle @ext_avif {
# respond Content-Type image/avif
# rewrite * {http.request.uri.path}
# file_server {
# root /home/deploy/wordpress.website.com/wp-content
# }
# }
#
# handle @ext_webp {
# respond Content-Type image/webp
# rewrite * {http.request.uri.path}
# file_server {
# root /home/deploy/wordpress.website.com/wp-content
# }
# }
#
# handle {
# rewrite * {http.request.uri.path}
# file_server {
# root /home/deploy/wordpress.website.com/wp-content
# }
# }
# }
@acceptsWebp {
header Accept *image/webp*
path_regexp webp ^(.+)\.(jpg|jpeg|png)$
}
handle @acceptsWebp {
@hasWebp file {re.webp.1}.webp
rewrite @hasWebp {re.webp.1}.webp
}
####################################
}
but i still get the misconfiguration error.
thanks in advance.
