Following redirection tutorial will result into:

http://europewebhosting.co > https://www.europewebhosting.co
http://www.europewebhosting.co > https://www.europewebhosting.co
https://europewebhosting.co > https://www.europewebhosting.co
http://europewebhosting.co > https://www.europewebhosting.co
http://europewebhosting.co > https://www.europewebhosting.co

You can redir php site created with WordOps from non-www to www version when you:

In /etc/nginx/sites-available/europewebhosting.co remove non-www version from server_name (leave www.europewebhosting.co, remove europewebhosting.co).

In /etc/nginx/conf.d/force-ssl-europewebhosting.co.conf edit file like:

server {
        listen 80;
        listen [::]:80;
        server_name europewebhosting.co www.europewebhosting.co;
        return 301 https://www.europewebhosting.co$request_uri;
}

Create new file nano /etc/nginx/conf.d/force-ssl-europewebhosting.co-redir.conf like:

server {
    server_name europewebhosting.co;
    include /var/www/europewebhosting.co/conf/nginx/ssl.conf;
    return 301 https://www.europewebhosting.co$request_uri;
}

Restart server:

nginx -t
service nginx restart

That's it!

[source]

Great tutorial! I could see this becoming part of the WordOps core at some point, like --enforce-www --enforce-ssl and auto-build those config files based on the domain.

8 months later

Thank you very much.
That's works!

Hosted by VirtuBox