I have trouble to set up a combination of url rewriting and fastcgi for nginx. The application server behind the fastcgi interface expects /myapp/ as base path. And I want to make this accessible under my http://myserver.com/
upstream appfcgi {
server 127.0.0.1:6000;
server 127.0.0.1:6001;
server 127.0.0.1:6002;
fair;
}
server {
listen 80 default;
server_name myserver.com;
root /var/www;
location / {
rewrite ^(/.*)$ /myapp$1 last;
}
location /myapp/ {
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass appfcgi;
}
No matter what I try I always get the root path of the application server displayed. I remember I had troubles back then doing the same with apache but forgot until today I tried to do it with nginx. Any help is appreciated. thanks.