Created
November 26, 2018 18:47
-
-
Save wizzle/17c4e139ce071849ad63da90e0e99fc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTTP redirect | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name .ya.ru; | |
return 301 https://ya.ru$request_uri; | |
} | |
# www, subdomains redirect | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name www.ya.ru; | |
ssl on; | |
ssl_certificate /etc/ssl/sites/ya/ya.ru.crt; | |
ssl_certificate_key /etc/ssl/sites/ya/ya.ru.key; | |
return 301 https://ya.ru$request_uri; | |
} | |
# accept and process the request | |
server { | |
listen 443 ssl; | |
server_name ya.ru; | |
ssl on; | |
ssl_certificate /etc/ssl/sites/ya/ya.ru.crt; | |
ssl_certificate_key /etc/ssl/sites/ya/ya.ru.key; | |
# This snippet detects whether mobile device or no | |
# and performs the redirect if yes | |
include ya-snippets/detect_mobile.conf; | |
include ya-snippets/base_config.conf; | |
} | |
server { | |
listen 443 ssl; | |
server_name m.ya.ru; | |
ssl on; | |
ssl_certificate /etc/ssl/sites/ya/m.ya.ru.crt; | |
ssl_certificate_key /etc/ssl/sites/ya/m.ya.ru.key; | |
include ya-snippets/base_config.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment