Sorry for the delay. It wasn't an error but the web pages were out of whack.
Some of the files were now found.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251952#msg-251952
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx
On Sat, Jul 19, 2014 at 11:51 PM, martyparish wrote:
> Unfortunately it did not. I was really hoping to do this with try_files
> instead of "if" and rewrite!
>
what error did you get
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailm
Unfortunately it did not. I was really hoping to do this with try_files
instead of "if" and rewrite!
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251941#msg-251941
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailm
On Sat, Jul 19, 2014 at 11:34 PM, martyparish wrote:
>
> actually this part was wrong;
> if (!-f $site_folder) {
> rewrite ^/[^/]+/(.*) /$1;
> }
>
> needs to be:
>
> if (!-d /etc/nginx/html/production/$site_folder) {
> rewrite ^/[^/]+/(.*) /$1;
> }
>
> * changed -f to -d
> ** had to add root path
actually this part was wrong;
if (!-f $site_folder) {
rewrite ^/[^/]+/(.*) /$1;
}
needs to be:
if (!-d /etc/nginx/html/production/$site_folder) {
rewrite ^/[^/]+/(.*) /$1;
}
* changed -f to -d
** had to add root path before $site_folder
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,
For anyone who comes across this scenario, here is how I got it working:
# get the first folder name into a variable ($site_folder)
map $uri $site_folder {
~^/(?P[a-zA-Z]+)/.*$folder ;
}
...
server {
...
Maybe you should set location as fixed generic and then use root to change
where ever it needs to, don't forget to tell php where stuff is if you
change root.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251928#msg-251928
___
nginx m
I will do that.
I guess my main question is:
can I use a variable in the location URI?
location ^~ /$site_folder/ {
It appears that the answer is no. I have confirmed the variable is set from
the map block. However, when I use it in location like above, it gets
skipped over.
I appreciate the
Enable debugging and check the logs, or add Lua and dump variables to see
what value is doing what (this is how I debug a flow).
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251923#msg-251923
___
nginx mailing list
nginx@nginx.org
ht
Okay, I finally got the mapped variable figured out!
map $uri $site_folder {
~^/(?P[a-zA-Z]+)/.*$folder ;
}
Now, I just need to figure out how to use it in the location block???
This is what I am trying:
location ^~ /$site_folder/ {
Thanks itpp2012
I was actually just experimenting with that approach! I was beginning to
have a bit of success too! Not quite there yet though.
map $uri $site_folder {
#~^/(?P[a-zA-Z]+)/.* $folder;
~^/(?P[a-z]+)/.* $folder;
}
I saw an example very similar(or
Maybe not exactly what your looking for but should give enough to rewrite
this for what you want with map.
https://gist.github.com/anonymous/68caceb6c935e7120a60
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251917#msg-251917
___
ngin
Thanks Francis!
Sorry for not being clear enough.
My code base is at:
/etc/nginx/html/production/
The "site1, site2, etc..." folders do not exists at all. They are only seen
and used in the public URLs.
The original config I posted in the first post works, I just don't like it
because there wi
On Fri, Jul 18, 2014 at 09:40:43AM -0400, martyparish wrote:
Hi there,
> I have many separate "sites" to run and they all use the same back end
> application(opencart). They also will be under the same domain, in folders.
> I don't want to duplicate the application code in each subdirectory.
It
I have been experimenting with this:
location ^~ /[a-zA-Z]+/ {
rewrite ^/(.*)/(.*) /$2;
}
Of course I am getting 404 errors...
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251908,251909#msg-251909
_
Hello nginx gurus,
First post but I have been reading this board for over a year!
My scenario:
I have many separate "sites" to run and they all use the same back end
application(opencart). They also will be under the same domain, in folders.
I don't want to duplicate the application code in each
16 matches
Mail list logo