My goal is to install a working web server, for local and packaged (RPM) applications, I will use phpMyAdmin as an example.

1. Installation :

yum --enablerepo=remi install php-fpm nginx phpMyAdmin

This command will also install the apache web server, listening on port 80. I will not use it, but I will configure nginx to listen on port 82.

2. Creating my web site

With nginx, pages are, by default, installed in the /usr/share/nginx/html directory.

My application will be very minimal:

echo '<?php phpinfo(); ?>' >/usr/share/nginx/html/nginfo.php

3. Nginx configuration

I'm really not an expert on this web server, but, reading the documentation (quite minimal), I found a working solution:

Change in the /etc/nginx/nginx.conf file.

Port :

        listen 82;

Alias for phpMyAdmin (after the commented section about PHP)

	location /phpMyAdmin { 
alias   /usr/share/phpMyAdmin;
index  index.php index.html index.htm;
}

PHP Configuration for phpMyAdmin

        location ~ /phpMyAdmin/.*\.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  /usr/share/$uri;
fastcgi_intercept_errors on;
include        fastcgi_params;
}

PHP configuration for my local application

        location ~ \.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
include        fastcgi_params;
}

This is probably not the simplest / best solution (I'd like to not have to configure php twice), your comments are welcome, I will try to improve it.

4. Launch the services

service php-fpm start
service nginx start

5. Test URL

6. Conclusion

It works !