По какой то причине указав auth_basic off - я всё равно получаю запрос на авторизацию
Если перед auth_basic off написать: "return 404;" то мне выдаёт 404 ошибку, без запроса авторизации.
server {
listen 80;
server_name dev.example.com;
root /var/www/dev.example.com/html/webroot/;
index index.php;
client_max_body_size 32m;
access_log /var/www/dev.example.com/access.log;
error_log /var/www/dev.example.com/error.log;
resolver 8.8.8.8;
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/javascript application/json application/xml+rss image/svg+xml;
location / {
auth_basic "Are you developer?";
auth_basic_user_file /var/www/dev.example.com/.htpasswd;
location ~ \.php$ {
try_files $uri $uri/ /index.php$is_args$args;
include /etc/nginx/fastcgi_params;
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param DEBUG true;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ".+\.(?:ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|css|swf|js|atom|jpe?g|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|map)$" {
access_log off;
log_not_found off;
expires max;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all; # запретить все для всех
return 404; # вернуть код ошибки
}
}
location ^~ /callback/ {
auth_basic off;
try_files $uri $uri/ /index.php$is_args$args;
include /etc/nginx/fastcgi_params;
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param DEBUG true;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}