All errors can be modified.
First create a file and give a name, for example: 500.html
.
I’ll put this in the directory /usr/share/nginx/error/
, this will prevent you from accessing the meusite.com/500.html
shows the error, by default the directory of the site is the usr/share/nginx/html/
. ;)
Change the settings to:
error_page 502 /500.html;
location = /500.html {
root /usr/share/nginx/error;
}
Normally the directory of the file you should change is /etc/nginx/conf.d/default.conf
, in the Centos.
For a better demonstration you should have something like this:
server {
listen 80;
server_name meusite.com.br;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 502 /500.html;
location = /500.html {
root /usr/share/nginx/error;
}
//...
}
I will take a test and post the result! Thank you very much for your reply!
– user41630