Laravel Forge计划任务上的504网关超时错误

I deployed an old custom PHP app with Laravel Forge and there are a couple of scheduled tasks that fail running. I tried running them from the terminal and for this command wget https://app/cronjobs/get-provider-stats I get the following output:

--2017-08-02 10:30:47--  https://app/cronjobs/get-provider-stats
Resolving app (app)... 46.xxx.xxx.xxx
Connecting to app (app)|46.xxx.xxx.xxx|:443... connected.
HTTP request sent, awaiting response... 504 Gateway Time-out
Retrying.

--2017-08-02 10:31:48--  (try: 2)  https://app/cronjobs/get-provider-stats
Reusing existing connection to app:443.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: ‘get-provider-stats’

in the get-provider-stats file there is the 504 Gateway Time-out HTML page content.

I also checked the nginx logs, and here is the output:

2017/08/02 10:32:48 [error] 4342#4342: *438 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: app, request: "GET /cronjobs/get-provider-stats HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock", host: "app"

I tried changing the PHP CLI configuration as listed below:

max_inputution_time = 300 (from 30)
max_input_time = 600 (from 60)

This haven't fixed my problem though. Any ideas what else can I try?

It is not a issue of timeouts.

Please recheck your cron command.

Since it does not get any response it throws 504.

try to specify cron options..