S
S
SteepNET2019-05-17 17:23:03
Nginx
SteepNET, 2019-05-17 17:23:03

NGINX include and fastcgi_pass?

Good day!
I can't figure out the issue with setting up NGINX.
We have ISPManager 5 lite and everything is written there automatically, the programmer requested include in the nginx settings and now I can’t understand why if everything is returned to the standard config, the site does not work ...

location / {
    include /etc/nginx/vhosts-resources/site.ru/rewrite/*.conf;
 		fastcgi_pass    unix:/var/www/php-fpm/webmaster.sock;
    include fastcgi_params;
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
      expires max;
    }
  }
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@site.ru";
    fastcgi_pass unix:/var/www/php-fpm/webmaster.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
    fastcgi_read_timeout 300;
    include fastcgi_params;
  }

include /etc/nginx/vhosts-resources/site.ru/rewrite/*.conf;
fastcgi_pass unix:/var/www/php-fpm/webmaster.sock;
include fastcgi_params;
These parameters are in the top location that should not be there and when creating a new site they are not there, but the site does not work without them.
There is nothing special in the include, some rewrites and redirects have a couple of locations on capcha
Maybe I did the include in the wrong place to the section below?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2019-05-25
@BuriK666

location @php {
.....
include fastcgi_params;
}

nginx.org/ru/docs/http/ngx_http_core_module.html#l...
The “@” prefix specifies a named location. Such a location is not used in normal request processing, but is intended only for redirecting requests to it. Such locations cannot be nested and cannot contain nested locations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question