Nginx non www redirect to www + https 筆記
Ngnix conf 的寫法,在 /etc/nginx/sites-enabled/ 新增 sitename.com
server {
server_name sitename.com;
rewrite ^ https://www.sitename.com$request_uri? permanent;
}
certbot -d
sitename.com(過程中選2,會幫你加入 https 相關內容)
順利的話,當你輸入
https://sitename.com/1234 > https://www.sitename.com/1234
路徑變動也會跟著跑
留言