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:
However, if I manually replace 0.0.0.0:8000 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_pass http://0.0.0.0:8000;
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.