include /etc/nginx/sites-enabled/*.conf;
#auth.conf
map $user_id:$request_uri $allow {
default 0;
1234:/path/page1.html 1;
1234:/path/page2.html 1;
5678:/path/page1.html 1;
...
}
#host.conf
include "auth.conf";
server {
listen 80;
server_name host.org;
root /path/to/static/pages;
location / {
auth_request /_auth;
}
location = /_auth {
if ($allow) {
return 200;
}
return 403;
}
}
log_not_found off;
отключит запись в error_log ошибок о том, что файл не найден. А error_log настраивается так nginx.org/ru/docs/ngx_core_module.html#error_log location ~ ^/downloadfile/ {
proxy_pass ...
}
Content-Disposition: attachment;filename=your_pdf.pdf
server {
listen 80;
server_name point.local;
root /home/kulikov/www/point.local/httpdocs/;
try_files $uri /index.php?$args;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|avi|djvu|mp3|mp4|ogv|3gp)$ {
root /home/kulikov/www/point.local/httpdocs;
}
error_log /home/kulikov/www/point.local/logs/nginx_error.log;
access_log /home/kulikov/www/point.local/logs/nginx_access.log;
}