Followed the correct method for setting the URL to be www.
https://easyengine.io/tutorials/nginx/www-non-www-redirection/
Okay so the site was redirecting www to be non-www. But since there are quite a few backlinks that where www. Need to change the WordPress site so that it is www. Currently it is non-www. The issue was when changing the site config file for Ngnix.
server {
listen 80;
server_name localhost 999.999.99.99 www.domain.com domain.com;
root /var/www/domain.com/web;
if ($http_host != "www.domain.com") {
rewrite ^ http://www.domain.com$request_uri permanent;
}
Then restart Ngnix, that part works fine. But when updating the site URL and home URL to be both www in the WordPress options db table. I can not log into the dashboard site.
I know I will need to run a site update so that all links are www from non-www.
https://wordpress.org/plugins/velvet-blues-update-urls/
Any help would be appreciated.