Score:0

Replace nginx text on default nginx error pages

th flag

How it's possible to replace this text this with custom one on every default nginx error page?

Ginnungagap avatar
gu flag
Just grab the default nginx error page and change the footer? That won't change much of anything but if that's your thing...
th flag
Where can I find the default nginx error page template
Score:0
cn flag

Copy contents of the current error page by visiting the error page and in most browsers pressing Ctrl+U.

Paste the contents into a new file, 502.html, and remove or replace the offending portions of the new file.

Place 502.html in the root directory for the server (e.g., /var/www/html, /var/www/example.com/public/, etc.).

In the desired location or server, or even under http, add:

error_page 502 /502.html;

There may be other or better ways to accomplish the same described in the error_page documentation.

th flag
Yes but I dont want just one error page. I want to replace all default nginx pages with custom one
Paul avatar
cn flag
The linked `error_page` explains you can do this for every error code, exactly as in my answer, just replace `502` with the desired code.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.