Create a custom maintenance page that you would like to display to your users.
Change your Nginx configuration to include the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
include /etc/nginx/extra.d/maintenance.conf;
location / { # Adding the following "if" statement config under "location" directive if (-e /var/tmp/nginx/maintenance) { set $maintenance on; } if ($intra) { set $maintenance off; } if ($maintenance = on) { error_page 503 /maintenance.html; return 503; } ... } ...
The dots in the above example are a placeholder for the rest of your configuration file and should be removed.
Edit maintenance.conf file under “/etc/nginx/extra.d/maintenance.conf”
1 2 3 4 5
set $maintenance off;
location = /maintenancfe.html { internal; }
(optional) If you want to exclude some IP or IP range from hitting the maintenance page (e.g. for development), Edit your geo.conf /etc/nginx/conf.d/geo.conf
Comments