Advice on max_ranges for specific location block
sephreph
nginx-forum at nginx.us
Thu Mar 6 11:21:22 UTC 2014
Hi,
Hopefully this question isn't too basic, I just want to check if I'm missing
something obvious.
I'm setting up a basic nginx installation with php-fpm behind it running on
127.0.0.1:9000 - that's working fine. I'm using max_ranges set to 5
globally in the server block (example below), but I have a specific PHP
script (/free.php) that I want max_ranges set to 0 for. I'm not sure how to
achieve this.
max_ranges needs to be in a http, server or location block, so would the
best solution be to copy the "location ~ \.php" block and call it "location
~* /free.php" and just add the "max_ranges 0" setting in there? I was
hoping that location blocks cascade so I could overwrite that setting and
then the request would fall into the .php block but I don't think that's
actually the case?
A basic example of what I'm currently using is:
server {
listen 80;
server_name localhost;
max_ranges 5;
location / {
root /var/www/example.com;
index index.php;
}
location ~ \.php {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.*)") {
set $script $1;
set $path_info $2;
}
client_body_temp_path /tmp 1;
client_max_body_size 2048m;
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 300;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/example.com$script;
include /etc/nginx/fastcgi_params;
}
}
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,248175,248175#msg-248175
More information about the nginx
mailing list