Set maintenance page in nginx
Problem
When you need to stop the web application and do some maintenance, sometimes it may take a bit while so you want to show a custom maintenance page
Solution
Config in your application’s configuration in Nginx:
1 | root /path/to/project; |
You just need to put a “maintenance.html” page under the /path/to/project path, and when in maintenance, just comment out the line of return 503;. Then Nginx will return 503 for every request under / and it will map 503 to page “maintenance.html”.