nginx "try_files" directive is not allowed here
You could use regexps in server_name
. So it's better to use two server blocks.
server { listen 8080 default_server; root /path/to/current/web; location / { try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /site.php/$1 last; } ...}server { listen 8080; server_name ~^admin; # or better, if they all starts with "admin." token # server_name admin.*; root /path/to/current/web; location / { try_files $uri @rewriteadmin; } location @rewriteadmin { rewrite ^(.*)$ /admin.php/$1 last; } ...}