L
L
LittleTOXA2015-05-13 12:25:56
Nginx
LittleTOXA, 2015-05-13 12:25:56

Please check the nginx rule?

Is there a contradiction in such a setting? Those. I ask to process app.php in a certain way, but it is written *.php to give fastcgi. It is not right? How to make an exception?
location /app.php {
try_files $uri $uri/ /app.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm-site.ru.sock;
fastcgi_index index.php;
include fastcgi_params;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Alibabaevich, 2015-05-14
@dimitrius86

Do this:
location /app.php {
try_files $uri $uri/ /app.php?$args;
}
location ~ \.php$ {
root $root_path;
#limit_conn one 10;
try_files $uri =404;
fastcgi_index index.php;
proxy_read_timeout 120;
proxy_ignore_client_abort on;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_cache off;
fastcgi_connect_timeout 60;
fastcgi_cache_valid 200 301 302 304 5m;
fastcgi_cache_key \ "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
fastcgi_hide_header "Cache Control";
fastcgi_hide_header "Expires";
expires 4M;
include fastcgi_params;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question