当前位置: 首页 > Linux > 正文

Nginx – The Best Way to Force Redirect to HTTPS with WWW URL

Questions- How do I force redirect users to https with www prefix domain. How do I redirect a user to https in Nginx? The Best Way to Force Redirect Users to WWW and HTTPS.

This tutorial will provide you the best way to redirect users forcefully to https:// URL with www domain prefix. For example, your domain name is example.com, Below configuration will forcefully redirect users to https://www.example.com in all way.

Let’s edit Nginx virtual host configuration file and add below content. change example.com with your actual domain name. Also, add any other required settings specific for you Virtual host.

After making the change to the configuration file, restart your Nginx server and try to access your domain like URLs. In all conditions, it will be redirected to https://www.example.com.

http://example.com
http://www.example.com
https://example.com

 

Nginx – The Best Way to Force Redirect to HTTPS with WWW URL

本文固定链接: http://t.yjsec.com/index.php/2017/12/02/14/ | 下一站

该日志由 admin 于2017年12月02日发表在 Linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: Nginx – The Best Way to Force Redirect to HTTPS with WWW URL | 下一站
关键字:

Nginx – The Best Way to Force Redirect to HTTPS with WWW URL:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter