Welcome! Log In Create A New Profile

Advanced

Re: nested location, proxy, alias and multiple "/" locations

January 19, 2014 04:57AM
>> I'm not sure what you're trying do to.
My bad, I'll explain it in other way.

There's a web root /var/www/site/ that responds to http://www.site.com
Then there's a Laravel (front controller php framework) installation in /var/www/Laravel1, and its web root folder is in /var/www/Laravel1/public/ (index.php and static files are there)
I want to let that Laravel app to respond to URIs under /app1/:
http://www.site.com/app1/
http://www.site.com/app1/index.php
(same - but I had problems that the file was downloading as plaintext in my experiments)
http://www.site.com/app1/api/method (pretty urls)
http://www.site.com/app1/css/bootstram.min.css (static files)

There will be more that one such app sitting under various subfolders of a single web site.
--------------

>> 1. what happens to an "alias" inside a "^~" location like
>> "location ^~ /app1 { ... }"
>> – seems like $uri is not changed
>> and "/abcdef" part remains in place.
> It should do what the docs say -- http://nginx.org/r/alias

The docs only says about a simple "location /i/" case
and a regexp case.
My q is "location ^~ /i/" which seems to skip the replacement as in the simple case:
location ^~ /app1/ {
alias /var/www/Laravel/public/;
proxy_pass http://127.0.0.1:8081;
This example passes unchanged "/app1/api/method" to the proxy, instead of "/api/method"

Re. #2 — figured that out, thanks.


Sergei Sokolov.
Subject Author Posted

nested location, proxy, alias and multiple "/" locations

sergiks January 18, 2014 03:58PM

Re: nested location, proxy, alias and multiple "/" locations

Francis Daly January 18, 2014 08:32PM

Re: nested location, proxy, alias and multiple "/" locations

sergiks January 19, 2014 04:57AM

Re: nested location, proxy, alias and multiple "/" locations

Francis Daly January 19, 2014 06:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready