Is this possible with NGINX Unit with PHP?

Valentin V. Bartenev vbart at nginx.com
Mon Sep 9 14:03:34 UTC 2019


On Sunday 08 September 2019 02:02:03 James Stine wrote:
> Hello everyone,
> 
> This is my first time using one of these mailing lists, I apologize if I'm
> doing something wrong ahead of time.  Thank you for understanding.
> 

Hi James,

You did all right.

> My question is about NGINX Unit with PHP for a specific server
> configuration, namely with routing.  My environment is something like this:
> 
> I have a wordpress path in "/var/www/wordpress" that I want to be setup on
> the root of my domain like this "http://example.com/".  Along with that, I
> want another app such as "phpMyAdmin" which is located at
> "/var/www/phpMyAdmin".  I want this to be off the same server
> configuration, but to be ran from the domain like this "
> http://example.com/pma".
> 
> The server just tries to request a path like this:
> "/var/www/phpMyAdmin/pma" where the "pma" is coming from the URI.
> 
> Thanks!

Unfortunatly there's no URI rewriting functinality in Unit.
It's planned for the future releases.

Currently, you should either put your phpMyAdmin sources into
the "pma" subdirectory or just create a symlink (pma -> ..).

If you're using nginx in front of Unit, then you can also
do such rewriting inside nginx like this:

  location /pma/ {
      proxy_pass http://<unit_ip>:<unit_pma_port>/;
  }


wbr, Valentin V. Bartenev



More information about the unit mailing list