server { listen 80 default; listen [::]:80; location / { root /public; } error_page 404 /404.html; # Old URLs. rewrite ^/posts/(my-first-post)/?$ https://blog.nsfisis.dev/posts/2021-03-05/$1/ permanent; rewrite ^/posts/(phperkaigi-2021)/?$ https://blog.nsfisis.dev/posts/2021-03-30/$1/ permanent; rewrite ^/posts/(cpp-you-can-use-keywords-in-attributes)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(python-unbound-local-error)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(ruby-detect-running-implementation)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(ruby-then-keyword-and-case-in)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(rust-where-are-primitive-types-from)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(vim-difference-between-autocmd-bufwrite-and-bufwritepre)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(vim-swap-order-of-selected-lines)/?$ https://blog.nsfisis.dev/posts/2021-10-02/$1/ permanent; rewrite ^/posts/(phperkaigi-2022-tokens)/?$ https://blog.nsfisis.dev/posts/2022-04-09/$1/ permanent; # I mistakenly wrote 2023 in the URL instead of 2024. rewrite ^/posts/2023-01-10/(neovim-insert-namespace-declaration-to-empty-php-file)/?$ https://blog.nsfisis.dev/posts/2024-01-10/$1/ permanent; }