I'm trying to make Nginx proxy multiple web applications (among others, Tiny Tiny RSS and phpPgAdmin) onto different subdirectories under the same domain.
For example, TT RSS is under /home/ttrss/www/, served by a PHP5 FPM process running under user "ttrss", and other webapps follow the same model.
Here is the relevant Nginx configuration :
# Tiny Tiny RSS
location /ttrss/ {
alias /home/ttrss/www/;
index index.php;
}
location ~ /ttrss/.*\.php$ {
if ($fastcgi_script_name ~ /ttrss(/.*\.php)$) {
set $valid_fastcgi_script_name $1;
}
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/ttrss/www/$valid_fastcgi_script_name;
}
I have never used Nginx before, and I'd like to know if the way I did it is the "right way", or if there's a different, easier or simply better way I didn't know about.