Answer the question
In order to leave comments, you need to log in
How to configure nginx to block access to the site and direct to the stub during maintenance?
There is a big nginx config with different location and proxy_pass on httpd. It is necessary to cut off httpd for a while and redirect all requests to a static page (stub) in another directory. What and where to write in the config for this?
Answer the question
In order to leave comments, you need to log in
An example of implementing a stub output when the backend is unavailable:
error_page 502 503 504 /maintenance.htm;
location ~ /maintenance\.(css|htm|jpg) {
root /usr/share/nginx;
}
<meta http-equiv="refresh" content="30" />
location / {
return 302 site.com/stub.html;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question