Welcome! Log In Create A New Profile

Advanced

Re: use subdirectories instead of subdomains

Thuban
April 25, 2014 04:00PM
* Jim Ohlstein <jim@ohlste.in> le [25-04-2014 14:17:33 -0400]:
> Hello,
>
> On 4/25/14, 1:17 PM, Thuban wrote:
> >>> root /var/www/mysite;
> >>> location /owncloud {
> >>> alias /var/www/mysite/owncloud;
> >>> include /etc/nginx/conf.d/owncloud.conf;
> >>> }
> >>>
> >>>, but services like owncloud need `location` rules too, so I finally
> >>>have "location /example is outside location" errors.
> >>>
> >>>How can I configure nginx for this?
> >>
> >>Why are you using an alias here? If the root is /var/www/mysite then
> >>
> >>location /owncloud
> >>
> >>would be interpreted as /var/www/mysite/owncloud which I'm guessing
> >>is what you want.
> >
> >Because the owncloud.conf contains `location` rules like this :
> >
> > location = /robots.txt {
> > allow all;
> > log_not_found off;
> > access_log off;
> > }
> > location / {
> > # The following 2 rules are only needed with webfinger
> > rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
> > rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
> >
> > rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
> > rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
> >
> > rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
> >
> > try_files $uri $uri/ index.php;
> > }
> >
> > # deny direct access
> > location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
> > deny all;
> > }
> >
> > # enable php
> > location ~ ^(.+?\.php)(/.*)?$ {
> > try_files $1 = 404;
> > include fastcgi_params;
> > fastcgi_param SCRIPT_FILENAME $document_root$1;
> > fastcgi_param PATH_INFO $2;
> > fastcgi_param HTTPS on;
> > fastcgi_pass unix:/var/run/php5-fpm.sock;
> >
> > }
> >
>
> I'm still not sure you've actually given a reason why you need an alias.
>
Infact, I don't have a good reason for using alias, I just found this
proposal on the web while I was trying to configure this.

I also would like to use includes, because I might need to add other
services on the host and keeping things clean.

The idea is to define some subdirectories as is they were "new root".

Sorry if my english isn't clear...

Thank you for links, I will read.

Regards

--
,--.
: /` ) Thuban
| `-' PubKey : http://yeuxdelibad.net/Divers/thuban.pub
\_ KeyID : 0x54CD2F2F
Envoyé à partir de mon serveur auto-hébergé
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

use subdirectories instead of subdomains

Thuban April 25, 2014 12:08PM

Re: use subdirectories instead of subdomains

Jim Ohlstein April 25, 2014 12:54PM

Re: use subdirectories instead of subdomains

Thuban April 25, 2014 01:20PM

Re: use subdirectories instead of subdomains

Jim Ohlstein April 25, 2014 02:18PM

Re: use subdirectories instead of subdomains

Thuban April 25, 2014 04:00PM

Re: use subdirectories instead of subdomains

Jim Ohlstein April 25, 2014 04:44PM

Re: use subdirectories instead of subdomains

Thuban April 27, 2014 12:18PM

Re: use subdirectories instead of subdomains

itpp2012 April 25, 2014 03:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready