I'm running a docker container with Wordpress, MYSQL and PHP on my Centos 7 VPS.

I can access the frontend of my blog fine. I can also log into the admin panel and install plugins, but when I try to save pages, save posts, or make any kind of update to them, I get the following errors:

enter image description here

However, if I manually replace with my domain name, e.g. domain.com/wp-json/wp/v2/, then I don't get the error.

This is my Nginx setup:

server {

        server_name domain.com www.domain.com;

        location / {
           proxy_set_header X-Forwarded-Host $host;
           proxy_set_header X-Forwarded-Proto $scheme;

    if ( $http_host ~* "www\.(.*)") {
           return 301 https://$1$request_uri;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


server {
    if ($host = www.domain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = domain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name domain.com www.domain.com;
    listen 80;
    return 404; # managed by Certbot


I need to some how get Wordpress to use my domain at all times.


Modify wp-config.php and add WP_HOME and WP_SITEURL. https://wordpress.org/support/article/changing-the-site-url/

Or just change it on your database (inside wp_options)

  • I did this earlier and it didn't make a difference. Also, the entries in my database were already correct – LondonGuy Jun 15 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.