Welcome! Log In Create A New Profile

Advanced

Re: basic-authentication and php?

May 23, 2009 01:31AM
On Fri, May 22, 2009 at 10:52:19PM +0100, Ian Hobson wrote:

> Igor, Jim, Michael
>
> Many thanks to all your help.
>
> That aspect of the site is working properly now in both IE and FireFox.
>
> Tomorrow I will try to get my head round the nginx version of
>
> RewriteRule ^/ppg/(email|print)/(quote|ack|amend)(\d+)\.pdf$
> /ppg/index.php?view=$2&act=$1&id=$3

The faster way (0.7.x):

location ^~ /ppg/ {
auth_basic "Hello, Please login";
auth_basic_user_file /var/www/site.com/passwords;

location ~ ^/ppg/(email|print)/(quote|ack|amend)(\d+)\.pdf$ {
fastcgi_pass 127.0.0.1:9000;

fastcgi_param SCRIPT_FILENAME /path/to/php/ppg/index.php;
fastcgi_param QUERY_STRING view=$2&act=$1&id=$3;

# fastcgi_params0 must have no SCRIPT_FILENAME and QUERY_STRING
include /etc/nginx/fastcgi_params0;
}

location ~ .\php$ {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}

The slower way:

location ^~ /ppg/ {
auth_basic "Hello, Please login";
auth_basic_user_file /var/www/site.com/passwords;

rewrite ^/ppg/(email|print)/(quote|ack|amend)(\d+)\.pdf$
/ppg/index.php?view=$2&act=$1&id=$3
last;

location ~ .\php$ {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

basic-authentication and php?

Ian Hobson May 22, 2009 11:56AM

Re: basic-authentication and php?

Jim Ohlstein May 22, 2009 12:30PM

Re: basic-authentication and php?

Ian Hobson May 22, 2009 01:12PM

Re: basic-authentication and php?

mike May 22, 2009 01:27PM

Re: basic-authentication and php?

Jim Ohlstein May 22, 2009 01:31PM

Re: basic-authentication and php?

mike May 22, 2009 01:36PM

Re: basic-authentication and php?

Jim Ohlstein May 22, 2009 01:45PM

Re: basic-authentication and php?

Igor Sysoev May 22, 2009 01:42PM

Re: basic-authentication and php?

Jim Ohlstein May 22, 2009 01:54PM

Re: basic-authentication and php?

Igor Sysoev May 22, 2009 01:21PM

Re: basic-authentication and php?

Ian Hobson May 22, 2009 05:52PM

Re: basic-authentication and php?

Igor Sysoev May 23, 2009 01:31AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
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