I got a PHP application with Core in /srv/myapp/src/www
.
This application can have plugins in /srv/myapp/plugins/pluginname
.
Plugin's entry point is /srv/myapp/plugins/pluginname/www
and corresponding url is something like /pluginname/?arg=value
.
I can't figure out how to get a working nginx config with that. My base is:
server {
listen 80;
server_name localhost;
root /srv/myapp/src/www;
index index.php;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
It's working well for all Core related URLs.
I tried to add the following for a given plugin:
location /plugins/movies {
alias /srv/myapp/plugins/movies/www;
try_files $uri /plugins/movies/index.php?$args;
}
It does work to serve static content (js assets & co) but any URL like /plugins/movies/?id=12
gives a
2016/12/09 15:12:25 [error] 20491#0: *534 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 172.17.42.1, server: localhost, request: "GET /plugins/movies/index.php?id=12 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
How can I configure nginx to get it work ?