2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[ Nginx × KUSANAGI ] www 付きドメイン から www なしドメインへのリダイレクト設定

Last updated at Posted at 2018-03-03

環境

  • さくらの VPS
  • KUSANAGI ( CentOS 7 )
  • WordPress
  • KUSANAGI で SSL 化済み

設定

  • /etc/nginx/conf.d 内の example_ssl.conf の下記のように編集する
#=======================================
# example.com SSL
#---------------------------------------

server {
    listen 443 ssl http2;
    server_name www.example.com;
    rewrite ^ https://example.com$request_uri?;
}

server {
    listen       443 ssl http2;
    server_name  example.com;
    # 以下省略
}
  • 編集後、nginx -s reload or kusanagi restart で Nginx を再起動
2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?