Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx auth_basic support #25

Open
hellysmile opened this issue Jul 15, 2012 · 1 comment
Open

nginx auth_basic support #25

hellysmile opened this issue Jul 15, 2012 · 1 comment

Comments

@hellysmile
Copy link

nginx auth_basic causes recursive redirects

@ukko
Copy link
Owner

ukko commented Jul 16, 2012

Hello, I can not repeat the mistake. Please show your config nginx.

server {
    listen readmin.local:80;
    server_name readmin.local;
    index index.php index.html;
    root /www/readmin/www;
    client_max_body_size 30m;

    location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff|\.pdf$ {
        expires 30d;
    }

    if (!-e $request_filename) {
        rewrite ^.*$ /index.php last;
    }

    location ~ \.php$ {
        auth_basic "Restricted";
        auth_basic_user_file /www/readmin/www/.htpasswd;

        include /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME /www/readmin/www$fastcgi_script_name;
    }

    location ~ /\.git/ {
        deny all;
    }
}

cat www/.htpasswd (test:test)

test:$apr1$58dDdfbQ$afPZlGoCNYiEHLULm2.y8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants