Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Last active January 31, 2020 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/1265ee51dc6e8f3ea279b622d78b4aeb to your computer and use it in GitHub Desktop.
Save pandanote-info/1265ee51dc6e8f3ea279b622d78b4aeb to your computer and use it in GitHub Desktop.
nginxで80番ポートに来たアクセスを443番ポートに転送するための設定。panda大学習帳での表示用。
http {
(中略)
server {
listen 80 default_server;
listen [::]:80 default_server;
(前略)
# location定義の前あたりに挿入。
# 実際の設定として使用する際には、ドル記号の前のバックスラッシュは不要。
return 301 https://\$host\$request_uri;
(後略)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment