Maintenance page with Nginx with specific permitted access

At the moment, we’re in a fairly complicated upgrade of a Magento live store and during the upgrade window, it is necessary to put up a holding page. A simple maintenance.flag file isn’t going to cut it for this process, so cutting off users at the web server is more suitable. For this particular customer, they have a complex 3 server cluster running a single site with over 240,000 unique visitors per day, so Nginx was a more appropriate choice. Going into maintenance Putting up a maintenance page with a 503 header is required, but in addition to this, to make sure payment gateway IPNs can function correctly, we need to permit access to some URLs (where we do not know the source IP address), eg. PayPal or Ogone. Also, we’ll need to add our own IP address to the allow list. In the Nginx vhost configuration file: server { … Continue reading