404 Poetry

Turn your website's 404 page into a poetry creation tool.


Add an error_page to your server block if you don't have one already.


server {
    root /var/www/your.website;
    index index.html index.htm index.nginx-debian.html;
    server_name your.website www.your.website;

    error_page 404 /404.html;

    location / {
            try_files $uri $uri/ =404;
            autoindex on;


Replace your 404.html with something like this. Customize the styles to your liking. Sorry, I'm sure the code could be better.


<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>404 poem</title>
        body {
            font-family: serif;
            font-size: 16px;
            line-height: 18px;
            padding: 20px;
    <main id="poem">
        <!-- this is where your poem will go -->
    <script defer>
        const url = new URL(window.location);
        let poem_clean = decodeURI(url.pathname);
        let poem = poem_clean.split('/');
        let html_poem = [];

        poem.map(line => {
            html_poem.push(line + '<br>');

        document.querySelector('#poem').innerHTML = html_poem.join('');

Using your new poem writer

You can now write poems by typing them after your url.

/ => line break

example poem: