config file for only static files.

Amer Shah amerrahman at gmail.com
Sun Apr 6 12:07:08 MSD 2008


Thanks for the reply Aleks!

I changed my conf to have www www. I put this at the top of my conf:

user www www;

Now, to confirm:

DX-20070509-049# ps aux | grep nginx
root  84389  0.0  0.1  2040  1632  ??  Is    3:44AM   0:00.00 nginx: master
process ./nginx
www   84390  0.0  0.1  2360  1968  ??  S     3:44AM   0:00.03 nginx: worker
process (nginx)
www   84391  0.0  0.1  2360  1968  ??  S     3:44AM   0:00.02 nginx: worker
process (nginx)
www   84392  0.0  0.1  2360  1968  ??  S     3:44AM   0:00.03 nginx: worker
process (nginx)
www   84393  0.0  0.1  2360  2020  ??  S     3:44AM   0:00.02 nginx: worker
process (nginx)
www   84394  0.0  0.1  2360  1968  ??  S     3:44AM   0:00.02 nginx: worker
process (nginx)
root  84407  0.0  0.0  1552  1036  p0  R+    3:46AM   0:00.00 grep nginx

And finally, the permissions:

DX-20070509-049# cd /usr/local/www
DX-20070509-049# ll
total 14
lrwxr-xr-x  1 root  wheel    27 Apr  2 21:41 cgi-bin ->
/usr/local/www/cgi-bin-dist
dr-xr-xr-x  2 root  wheel   512 Apr  2 21:41 cgi-bin-dist
drwxr-xr-x  9 root  www    3584 Apr  6 03:45 data
dr-xr-xr-x  2 root  wheel  1024 Apr  2 21:41 data-dist
drwxr-xr-x  3 root  wheel  3584 Apr  2 21:41 icons
drwxr-xr-x  2 www   www     512 Apr  6 03:25 proxy

It seems www has permissions to /usr/local/www/data

My error log shows this :

2008/04/06 03:44:38 [error] 84393#0: *1 directory index of
"/usr/local/www/data/" is forbidden


On Sun, Apr 6, 2008 at 3:01 AM, Aleksandar Lazic <al-nginx at none.at> wrote:

> Hi Amer,
>
>
> On Sam 05.04.2008 22:01, Amer Shah wrote:
>
> > Hey Guys.
> >
> > I've been trying to figure this out from the site but I just can't :(
> >
> > What I want is the following
> > - When a user puts it just my domain name, I want the server to give
> > him the index.htm file .. i.e. if the user enters in example.com I want
> > him to get www.example.com/index.htm
> >
> >
> > I tried the following but it I get a 403 forbidden:
> >
> >    server {
> >       listen       80;
> >       server_name  localhost;
> >       root /usr/local/www/data;
> >
> >       location / {
> >         index index.htm;
> >       }
> >  }
> >
> > Am I missing something ?
> >
>
> does user nobody is allowed to read your root?
>
> http://wiki.codemongers.com/NginxMainModule#user
>
> What is in the error_log?
>
> http://wiki.codemongers.com/NginxMainModule#error_log
>
> Cheers
>
> Aleks
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080406/a5e4e186/attachment.html>


More information about the nginx mailing list