I set up a Wordpress site with Caddy and it was successful, environment Ubuntu 18.04, + Wordpress 5.2, + Caddy 1.0.0 + PHP 7.0 + MySQL 5.7.
But when I tried to upload a video, it shows HTTP error. the file size is 29M. There’s no issue when i tried to do that with file less than 10M.
I’ve modified the below items in php.ini, but it’s not working.
upload_max_filesize = 1024M
post_max_size = 1024M
I know there is “client_max_body_size” in nginx setting to modify the max body size, and also tried to set the similar thing in Caddyfile. But it still won’t work. Can anybody help me on that?
Add the log and errors directives to your Caddyfile, reload Caddy, reproduce the error again by attempting an upload, and then post the contents of the log/error files.
Thanks @Whitestrake, below are my errors log. When I found it was timeout related issue, I tried to modify my php.ini from max_execution_time = 30 to max_execution_time = 300, and restarted the php7.0 service, but it’s still not working.
Well, we should probably at least try to find out whether it’s an issue on the PHP-FPM side or the Caddy side. Are you able to configure nginx to temporarily replace Caddy and see if the error still occurs?
@Whitestrake, I have the nginx which is doing good, as I can set “client_max_body_size =500m” in nginx.conf to unlimit it.
I want to transfer all nginx to Caddy because it’s so handy. From the caddy errors log I believe it’s php7.0 related timeouts issue, but have no idea where to find and correct it.
I also tried different VPS with different Linux distribution such as Debian 9, Ubuntu 18.04, and same issue happened.
Not sure if anybody can set up a Wordpress with Caddy as what I did, and see if there’s similar issue of uploading.
First I tried just setting send_timeout. That fixed it stopping mid-upload, but I found that as soon as the POST finished (100% upload), it would 504 again. That’s because the sum request time had already exceeded the read_timeout.
Setting both to 600s allowed me to upload any filesize up to the PHP-set limits, as long as the transfer was finished under ten minutes.