Answer the question
In order to leave comments, you need to log in
How to set fastcgi_read_timeout for url with parameters in NGINX?
Good day. I use Opencart and this CMS for the admin panel generates links like /admin/index.php?route=catalog/mod2&user_token=VV
I need to make sure that for links where "/mod2" occurs, the program execution time is increased by the fastcgi_read_timeout directive.
Due to the fact that all this economy is passed only as parameters, it does not work out correctly to set the Location. If you use the if condition, then you can’t put fastcgi_read_timeout in it, I get an error. Are there any options at all?
It's just that one module on my site must have a very long program execution time.
Answer the question
In order to leave comments, you need to log in
location = /admin/index.php {
if ($arg_route ~ "/mod2") {
rewrite ^ mod2 last;
}
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_read_timeout 60;
}
location = mod2 {
rewrite ^ /admin/index.php break;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_read_timeout 1000;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question