Author Topic: Ningx www to none www  (Read 1287 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Ningx www to none www
« on: August 18, 2022, 08:18:19 AM »
Hi,
I have been trying to redirect one of the websites from www to none www. I have tried adding a redirect.conf  /etc/nginx/conf.d/redirect.conf

server {
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
}

I believe, I may need to change the listen directive to port 443, but I'm not sure how or where I need to add this and also add ssl info to the server block.
Or is there an easier way??

Nginx & Varnish & Apache
thanks in advance