Re: Convert Alias from apache (totally different root)

2017-06-07 Thread Francis Daly
On Tue, Jun 06, 2017 at 06:37:45PM -0400, ianwinter wrote:

Hi there,

> I've read the docs and understand how root and alias work within a location,
> but, neither can be used to convert what I've got in apache that I can see.
> 
> Take the example `Alias /media /path/to/assets` in apache, the location and
> path are completely different (media doesn't form any part either in
> addition or removed).

I'm not fully sure what you mean here, but I think that the above Apache
config means that a request for the url /media/file.png will be served
from the file /path/to/assets/file.png.

Something similar in nginx would be like

  location /media { alias /path/to/assets; }

but it is probably better in nginx to use something like

  location ^~ /media/ { alias /path/to/assets/; }

in case you have top-level regex locations that might interfere.

> The issue in converting to a location with alias or root is monitoring is
> still there, or, excluded - I need a way to change the location to
> completely use a different document root otherwise I'm not sure how I can?
> 
> location /media { root /path/to/assets; }

That should lead to a request for the url /media/file.png being served
from the file /path/to/assets/media/file.png.

That is probably not what you want here.

f
-- 
Francis Dalyfran...@daoine.org
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Re: Convert Alias from apache (totally different root)

2017-06-07 Thread ianwinter
I think a location elsewhere (with deny/allow's) had been causing issues.
I'm going to start from scratch on the server block and build it up slowly.

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,274717,274728#msg-274728

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Convert Alias from apache (totally different root)

2017-06-06 Thread ianwinter
I've read the docs and understand how root and alias work within a location,
but, neither can be used to convert what I've got in apache that I can see.

Take the example `Alias /media /path/to/assets` in apache, the location and
path are completely different (media doesn't form any part either in
addition or removed).

The issue in converting to a location with alias or root is monitoring is
still there, or, excluded - I need a way to change the location to
completely use a different document root otherwise I'm not sure how I can?

location /media { root /path/to/assets; }

Any advice appreciated!

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,274717,274717#msg-274717

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx