Commit 27276a4b authored by Owain Jones's avatar Owain Jones
Browse files

updated gliders config to use maintenance page if .maintenance file is found

parent fc26c753
......@@ -34,11 +34,20 @@ server {
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
limit_req zone=gliders burst=5;
index app.php;
limit_req zone=gliders burst=5;
set $index_file app.php;
if (-f $document_root/.maintenance) {
return 503;
}
index $index_file;
try_files $uri @rewriteapp;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
location ~ ^/(images|fonts|css|js) {
access_log off;
error_log off;
......@@ -99,70 +108,17 @@ server {
location / {
limit_req zone=gliders burst=5;
index app_dev.php;
set $index_file app.php;
if (-f $document_root/.maintenance) {
return 503;
}
index $index_file;
try_files $uri @rewriteapp;
}
location ~ ^/(images|fonts|css|js) {
access_log off;
error_log off;
try_files $uri =404;
expires 1y;
add_header Cache-Control "public";
}
location ~ ^/images/vehicles/(?<vehicle_type>[a-zA-Z0-9]+)_(?<vehicle_name>[a-zA-Z0-9]+)\.(png|jpg)$ {
access_log off;
error_log off;
try_files $uri images/vehicles/$vehicle_type.png =404;
}
location /static/logs {
alias /var/gliders/logs;
}
location /var/gliders/logs {
alias /var/gliders/logs;
}
location /static {
alias /var/gliders/static;
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass phpfcgi;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $symfony_root_dev/web$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
server {
listen 8000;
root $symfony_root_dev/web;
error_log /var/log/nginx/dev.gliders.error.log;
access_log /var/log/nginx/dev.gliders.access.log;
# Enable compression. Very helpful when we're getting stuff like
# large amounts of vehicle tracks in JSON form!
gzip on;
gzip_types text/plain application/xml text/html text/css application/json application/x-javascript text/xml text/javascript;
# strip app.php/ prefix if it is present
rewrite ^/app_dev\.php/?(.*)$ /$1 permanent;
location / {
limit_req zone=gliders burst=5;
index app_dev.php;
try_files $uri @rewriteapp;
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
location ~ ^/(images|fonts|css|js) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment