Welcome! Log In Create A New Profile


auth_basic restricted files with php

April 12, 2010 10:25AM

I've read a lot of threads ([url=http://forum.nginx.org/read.php?2,68890,68944#msg-68944]like this [/url]) but I can't solve my problem. It's my first day working with nginx, so I'm a really newbie.

Here is a part of my nginx.conf

[size=small]server {

listen 80;
server_name myserver.es;

location ~* /apc {
root /usr/local/nginx/htdocs/;
auth_basic "Restricted";
auth_basic_user_file /usr/local/nginx/htdocs/.htpasswd;
# rewrite ^/apc($|/.*) $1 break;

location ~.\.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/htdocs$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;

When I load in my browser myserver.es/apc.php the password for Restricted is requestes, so I introduce it. But then the browser does not load php, it shows the php in the browser. If I open myserver.es/index.php it's loaded properly, as other php files in my directory.

Any help? It woul be very apreciated :-)

Thank you in advance
Subject Author Posted

auth_basic restricted files with php

clinisbud April 12, 2010 10:25AM

Re: auth_basic restricted files with php

clinisbud April 13, 2010 02:40AM

Re: auth_basic restricted files with php

kblessinggr February 04, 2011 10:51AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready