Categories
Computer

WordPress 5.0, block editor and nginx

I updated yesterday to WordPress 5.0 and wanted to test the new editor. Unfortunately it didn’t work like the beta (Gutenberg)-version before. After opening a github-issue and more googling today, I found the solution. The culprit was nginx and that it doesn’t work with the REST-API from WordPress with the configuration as it was documented in the past. Thus I had to change it and Stack Overflow saved the day again.

Here is what I did:

Change:

       location / {
        try_files $uri $uri/ /index.php;
        }

to

       location / {
        try_files $uri $uri/ /index.php$is_args$args;
        }


and add

   location ~ ^/wp-json/ {
    # if permalinks not enabled
    rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}


So now I have only to find a way that h-cards work with twenty nineteen…

By nielsk

I am a sysadmin with a background in Japanese Science and economics. Thus my topics are computers, Japan and economics. My favorite past times are pen&paper-role playing games and old video games.

With a couple of friends I also podcast about retro video games in German: Retrozirkel

Leave a Reply

Your email address will not be published. Required fields are marked *