Created
August 26, 2014 02:17
-
-
Save nobuh/7ca4b0af0bf2e599d586 to your computer and use it in GitHub Desktop.
Zone Apex / Naked Domain / Root Domain redirect to the www subdomain by nginx
This file contains 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
# Zone Apex / Naked Domain / Root Domain redirect to the www subdomain by nginx | |
# Here is a part of nginx config file | |
# | |
# For example on Debian 6 (Squeeze) | |
# /etc/nginx/site-available/default | |
# | |
server { | |
listen 80; ## listen for ipv4 | |
listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
server_name your.domain; | |
rewrite ^/(.*) http://www.your.domain/$1 permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment