When requesting static resources from nginx, will nginx still submit it to php-fpm for processing?
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 17:25:01
0
2
340

For example, when I request a static resource such as txt, img, css, and js. Will nginx still hand this request over to php-fpm for processing?

Note that the requested resource URL corresponds to the root directory of the website one-to-one, and there is no rewriting or other circumstances.

If yes, please tell me how to optimize


My impression is that it won’t. Only when there is fastcgi_pass 127.0.0.1:9000; in the location block, it will be submitted to php-fpm, for example:

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /Library/WebServer/Documents/wordpress/$fastcgi_script_name;
        include        fastcgi_params;
    }

Let me ask a question and confirm whether this is the case.

过去多啦不再A梦
过去多啦不再A梦

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!