#!/bin/bash
apt-get -y install jpegoptim optipng imagemagick
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.jpg" -exec mogrify -verbose -resize '1024x1024>' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.jpg" | xargs -0 jpegoptim --strip-all
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.png" -exec mogrify -verbose -resize '1024x1024>' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.png" -exec optipng -o5 {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.gif" -exec mogrify -verbose -resize '1024x1024>' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.gif" -exec optipng -o5 {} \; -print
location / {
try_files $uri $uri/index.html $uri.html @backend;
}
location @backend {
if (-f /system/maintenance.html) {
return 503;
break;
}
proxy_pass http://backend;
}
error_page 503 /system/maintenance.html;
location = /system/maintenance.html {
root /srv/www/maint;
}