Ma ktoś pomysł jak ustawić, aby AUTH BASIC i USERAGENT nie obejmował 2 plików. /usr/share/nginx/www/folder1/statystyki.php i /usr/share/nginx/www/folder2/statystyki.php ??
server {
root /usr/share/nginx/www;
index index.php index.html index.htm;
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
#Make site accessible from
http://localhost/ server_name localhost;
location / {
auth_basic "AUTH";
auth_basic_user_file /etc/nginx/.htpasswd;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
location ~ \\.php$ {
root /usr/share/nginx/www;
fastcgi_split_path_info ^(.+\\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
if ($http_user_agent !~* "XXX2") {
return 444;
}
}
location ~ /folder {
root /usr/share/nginx/www;
charset windows-1251;
autoindex on;
}
}