Answer the question
In order to leave comments, you need to log in
How to configure NGINX so that it gives the necessary types of static files to PHP processing, and does not return it on its own?
Good afternoon!
I'm trying to set up a bunch of Nginx Apache Php, a noob in these matters.
It is necessary that some types of static files (for example, xls) are transferred to the php script for processing, and not returned immediately to the client.
If I add the desired file type to the section:
location / {
proxy_pass http://my_host:8080;
location ~* ^.+\.(jpeg|jpg|..список..|swf)$ {
root path_to_site/public_html;
expires max;
try_files $uri @fallback;
}
}
Answer the question
In order to leave comments, you need to log in
Nested locations are useless here - everything is the opposite for you, files with extensions are processed by nginx, and the rest goes to Apache.
If Apache is in charge of PHP processing, it is enough to leave the location with proxying to it. All received errors will be from within, and not from nginx.
If you have already passed php to some handler - for example php-fpm or mod-php in apache, then all you need is to find location ~ \.php$ and make it look like location ~ \.xls$
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question