Redirect To Non-www With SSL On Nginx

Posted By Weston Ganger

If you ever need to do some redirecting from www to non-www or vice versa with SSL on Nginx you can use the following config

# redirect block
server {
    listen 443 ssl;

    ssl_certificate /srv/www/;
    ssl_certificate_key /srv/www/;
    return 301$request_uri;

# ... actual server block ...

Related External Links:

Article Topic:Software Development - Web Development

Date:March 14, 2017