I faced with problem in configuring nginx server for yii2 basic app.
Here is my service block file :
server {
listen 80 ;
access_log /var/log/nginx/access-server.log;
error_log /var/log/nginx/error-server.log;
charset utf-8;
location /fetch {
root /usr/share/nginx/html/another_folder/web/;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
My project located in another folder "another_folder". And i want that when user goes to url : http://ip/fetch files nginx will serve files from another folder.
My error log file returns me :
2017/02/11 12:38:52 [error] 4242#0: *12 FastCGI sent in stderr: "Unable to open primary script: /usr/share/nginx/html/index.php (No such file or directory)" while reading response header from upstream
And brother shows : No input file specified.
Can you give help me with this issue?
Thank you!