LoginSignup
4
4

More than 5 years have passed since last update.

nginx設定 httpをhttpsにリダイレクト

Posted at

nginxでhttpのアクセスをhttpsにリダイレクトする方法
returnを使う方法。

server {
    listen 80;
    server_name example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443;
    ssl on;
    # ...
}
4
4
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
4
4