V
V
Vladimir Shiklgruber2015-07-23 21:22:04
Nginx
Vladimir Shiklgruber, 2015-07-23 21:22:04

Why is the config not working?

My task is to redirect all php files in the /api/ folder to fpm
Here I wrote

location ~ \api\.php$  { 
        try_files $uri /index.php =404;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
              rewrite ^(.*)$ /api/index.php break; 
        }

Oddly enough, this nonsense does not work.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-07-23
@aaadddminnn

location ~ ^/api/(.*)\.php$ {
and try_files, remove rewrite

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question