Welcome! Log In Create A New Profile

Advanced

basic auth for specific controller

Peter Premium
October 18, 2010 06:12AM
Hi,

we would like to provide basic auth for specific rails controllers
(/stats ...) with nginx (and passenger).

We tried the following.

server {
listen 80;
server_name www.myapp.de;
root /home/deployer/myapp/public;
passenger_enabled on;
rails_env production;

...

location ~ ^/(admin|awstats|webalizer|stats) {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/basic.auth;
}

...
}


This results in the following error:

2010/10/18 11:18:20 [error] 31331#0: *4 open()
"/home/deployer/myapp/public/stats" failed (2: No such file or
directory), client: xx.xx.xx.xx, server: www.myapp.de, request: "GET
/stats HTTP/1.1", host: "www.myapp.de"

Nginx responds with a 404 page.

It seems like the server tries to serve static files
(/home/deployer/myapp/public/stats).

Any ideas?


Thanks in advance!

Peter

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

basic auth for specific controller

Peter Premium October 18, 2010 06:12AM

Re: basic auth for specific controller

Peter Premium October 19, 2010 09:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready