nginx add trailing slash with wrong port

Dustin Oprea myselfasunder at gmail.com
Sat May 24 20:35:09 UTC 2014


On May 24, 2014 2:53 PM, "luc2" <nginx-forum at nginx.us> wrote:
>
> nginx rewrites :
>
> > http://localhost:8081/files
>
> to :
>
> > http://localhost:81/files/ # wrong port !
>
> while apache rewrites :
>
> > http://localhost:8082/files
>
> to
>
> > http://localhost:8082/files/
>
> is it possible to configure nginx to behave like apache ?
>
> /etc/nginx/conf.d/test.conf :
>
> > server {
> >     listen       81;
> >     location /files {
> >         alias /home/luc2/files;
> >         autoindex on;
> >     }
> > }
>
> /etc/httpd/conf.d/test.conf :
>
> > <VirtualHost *:82>
> >     Alias /files /home/luc2/files
> >     <Directory /home/luc2/files>
> >             Options indexes
> >             Allow from all
> >     </Directory>
> > </VirtualHost>
>
> Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,250338,250338#msg-250338
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Aliases (and any other configurable sharing a name with something in
Apache) generally don't do the same thing as in Apache. Just use "root"
inside the location block.

Dustin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140524/ac7fdd23/attachment.html>


More information about the nginx mailing list