Show maintenance page when .lock file is present

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!

0
nginx symfony
source share
1 answer

Move the if block inside the rewriteapp place.

+1
source share

All Articles