location ^~ /yms/ { alias /usr/share/yms/webgui/; index index.php; } location ~ ^/yms/.*\.inc$ { deny all; } location ~ ^/yms/(.+\.php)$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/share/yms/webgui/$1; fastcgi_param SCRIPT_NAME /yms/$1; fastcgi_pass unix:@PHP_FPM_SOCKET@; }