1

I'm using NGINX from nginx-extras and Ajenti V with ajenti-v-nginx and ajenti-v. I have PHP 5.6 installed. However when I execute this code from Flarum Installation:

location ~* \.php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
    fastcgi_index index.php;
}

And do a NGINX config check: sudo nginx -c /etc/nginx/nginx.conf -t I get

nginx: [emerg] open() "/etc/nginx/fastcgi_params" failed (2: No such file or directory) in /etc/nginx/conf.d/flarum.conf:39

Output of ls /etc/nginx/

conf.d  fcgi.conf  mime.conf  nginx.conf  proxy.conf

Edit1: Seems like it's AjentiV, I reinstalled NGINX and somehow the configs deleted itself

root@notascam:/etc/nginx# ls
conf.d        fastcgi_params  koi-win     nginx.conf    scgi_params      
sites-enabled  uwsgi_params
fastcgi.conf  koi-utf         mime.types  proxy_params  sites-available  
snippets       win-utf
root@notascam:/etc/nginx# sudo service nginx start
root@notascam:/etc/nginx# ls
conf.d        fastcgi_params  koi-win     nginx.conf    scgi_params      
sites-enabled  uwsgi_params
fastcgi.conf  koi-utf         mime.types  proxy_params  sites-available  
snippets       win-utf

==== Clicks the Restart Website button on Ajenti V ====

root@notascam:/etc# cd nginx
root@notascam:/etc/nginx# ls
conf.d  fcgi.conf  mime.conf  nginx.conf  proxy.conf
dat tutbrus
  • 204
  • 4
  • 12

2 Answers2

2

Every nginx setup is different. In your case there is no fastcgi_params files, instead there is fcgi.conf

So change below

include fastcgi_params; 

to

include fcgi.conf;
Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
0

You must find the fastcgi_params file, and write the absolute path of it; to find it, run the following

sudo find / -name "fastcgi_params"

It's usually /etc/nginx/fastcgi_params in Debian-based distros.

For example on debian and ubuntu by default there is /etc/nginx/fastcgi_params file that should look like this:

X 47 48 - IR
  • 1,250
  • 1
  • 15
  • 28