Single server with multiple hierarchies

Hi,

My directory structure is:
/usr/share/nginx/www
/magento/current ← This is my application
/phpmyadmin

I changed the root of the server to
/usr/share/nginx/www/magento/current.

Now my app works perfectly when I access http://myserver/index.php.

I would like to configured phpmyadmin such that it is accessible as
http://myserver/phpmyadmin/index.php.

Please note that the root of my application is different than the root
of phpmyadmin and both are to be served from the same server.

If I create a location with ^~ /phpmyadmin/ can I set a root in it? Will
I have to do something to pass the index.php to FCGI. Will this have to
be done in the location directive?

Thanks,
Yash

Posted at Nginx Forum:

On Wed, Aug 01, 2012 at 07:37:10AM -0400, yashgt wrote:

Hi there,

My directory structure is:
/usr/share/nginx/www
/magento/current ← This is my application
/phpmyadmin

I changed the root of the server to
/usr/share/nginx/www/magento/current.

You changed the server{}-level “root” directive, so that any location{}
that does not include its own “root” directive will use that one.

I would like to configured phpmyadmin such that it is accessible as
http://myserver/phpmyadmin/index.php.

Please note that the root of my application is different than the root
of phpmyadmin and both are to be served from the same server.

A http request comes in, and is processed by exactly one location. An
internal rewrite may cause it to then be processed by one other
location. This can happen again.

If I create a location with ^~ /phpmyadmin/ can I set a root in it? Will
I have to do something to pass the index.php to FCGI. Will this have to
be done in the location directive?

Yes to each. You’ll probably want to nest locations, like

location ^~ /phpmyadmin/ {
#root and other directives
location ~ php {
#php-relevant directives
}
}

Good luck with it,

f

Francis D. [email protected]

Bang on target. Nested locations worked perfectly.

Posted at Nginx Forum:

Hi yashgt,

I’m having a similar issue trying to get Magento and WordPress running
on a
single IP. On Apache this is easy using vhost. I’ve never used nginx
before,
so don’t know it all that well. I’ve read and done lots of googling and
your
post seems to be the closest to what I’m trying to archive. Would it be
possible for you to post a copy of you config>

Cheers,

Martin

Posted at Nginx Forum:

On Wed, Aug 15, 2012 at 10:35 PM, martinlove [email protected]
wrote:

Hi yashgt,

I’m having a similar issue trying to get Magento and WordPress running on a
single IP. On Apache this is easy using vhost. I’ve never used nginx before,
so don’t know it all that well. I’ve read and done lots of googling and your
post seems to be the closest to what I’m trying to archive. Would it be

That’d be different problem. Check this docs:

http://www.nginx.org/en/docs/http/server_names.html

Hi Yash,

Thanks for your prompt response. I’ll have a look at the docs.

Cheers,

Martin

Posted at Nginx Forum: