View ngxpagespeed.conf
# Enable pagespeed module by putting the following in http context | |
pagespeed on; | |
pagespeed Domain example.com; | |
pagespeed DownstreamCachePurgeLocationPrefix http://lb1.i; | |
pagespeed DownstreamCachePurgeMethod PURGE; | |
pagespeed DownstreamCacheRewrittenPercentageThreshold 95; | |
# This setting should be enabled when using HTTPS |
View nginx_with_cache.conf
# Based on articles: | |
# https://ruhighload.com/%D0%9A%D1%8D%D1%88%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+%D1%81+nginx | |
# https://wiki.enchtex.info/practice/nginx/cache | |
# https://gist.github.com/yanmhlv/5612256 | |
# https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html | |
# https://blog.runcloud.io/2017/10/28/nginx-caching-tutorial-wordpress.html | |
# https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps | |
# https://easyengine.io/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/ | |
View .htaccess
# check if there is a file named maintenance.html | |
# so when you want to disable maintenance mode just remname "mv maintenance.html maintenance.html.disabled" | |
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ /maintenance.html [R=503,L] | |
ErrorDocument 503 /maintenance.html |