guys!
I am trying to figure out how to show service only when a .lock file is present. The problem is that I am using symfony2 for my project. And I canโt make it work.
I am trying to do something like this (nginx config):
location / { if (-f $document_root/.lock) { rewrite ^ /maintenance last; break; } index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/.*\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; }
A page is displayed, but all static files are also redirected to / service. Please, help!
nginx symfony
IlyaDoroshin
source share