Alias which works like in other web servers
marc at corky.net
marc at corky.net
Sun Aug 5 01:04:10 MSD 2007
I already had this working like this. But unfortunately every single
request, for any file (jpg, swf...etc) gets passed to fastcgi, too...
Igor Sysoev wrote:
> On Sat, Aug 04, 2007 at 10:21:11AM +0100, marc at corky.net wrote:
>
>
>> I need / to point to /var/www/site, /blog to /var/www/wordpress,
>> /nagios to /var/www/nagios, /munin to /var/www/munin the /munin,
>> /nagios and /blog/wp-admin dirs should be password protected using auth.
>>
>> All dirs except /munin and /nagios have PHP scripts in them that need to
>> be run.
>>
>
> location / {
> root /var/www/site;
>
> fastcgi_pass ...
> fastcgi_index index.php;
> fastcgi_param SCRIPT_NAME $document_root$fastcgi_script_name;
> ...
> }
>
> location /blog/ {
> alias /var/www/wordpress/;
>
> fastcgi_pass ...
> fastcgi_param SCRIPT_NAME $request_filename;
> ...
> }
>
> location /blog/wp-admin/ {
> alias /var/www/wordpress/wp-admin/;
>
> auth_basic "adm";
> auth_basic_user_file conf/nginx.user;
>
> fastcgi_pass ...
> fastcgi_param SCRIPT_NAME $request_filename;
> ...
> }
>
> location /nagios/ {
> root /var/www;
>
> auth_basic "adm";
> auth_basic_user_file conf/nginx.user;
> }
>
> location /munin/ {
> root /var/www;
>
> auth_basic "adm";
> auth_basic_user_file conf/nginx.user;
> }
>
>
>
More information about the nginx
mailing list