2012-07-23 12:43:04 +02:00
|
|
|
# www to non-www redirect -- duplicate content is BAD:
|
|
|
|
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
|
|
|
|
# Choose between www and non-www, listen on the *wrong* one and redirect to
|
|
|
|
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
|
|
|
|
server {
|
|
|
|
# don't forget to tell on which port this server listens
|
|
|
|
listen 80;
|
2013-01-12 20:33:17 +01:00
|
|
|
|
2012-07-23 12:43:04 +02:00
|
|
|
# listen on the www host
|
|
|
|
server_name www.example.com;
|
|
|
|
|
|
|
|
# and redirect to the non-www host (declared below)
|
|
|
|
return 301 $scheme://example.com$request_uri;
|
|
|
|
}
|
|
|
|
|
2012-02-03 13:58:16 +01:00
|
|
|
server {
|
2013-11-20 21:40:02 +01:00
|
|
|
# listen 80 deferred; # for Linux
|
|
|
|
# listen 80 accept_filter=httpready; # for FreeBSD
|
|
|
|
listen 80;
|
2012-02-03 13:58:16 +01:00
|
|
|
|
2012-07-22 23:31:54 +02:00
|
|
|
# The host name to respond to
|
2012-02-03 13:58:16 +01:00
|
|
|
server_name example.com;
|
|
|
|
|
|
|
|
# Path for static files
|
|
|
|
root /sites/example.com/public;
|
|
|
|
|
|
|
|
#Specify a charset
|
|
|
|
charset utf-8;
|
|
|
|
|
|
|
|
# Custom 404 page
|
|
|
|
error_page 404 /404.html;
|
|
|
|
|
2012-07-22 23:31:54 +02:00
|
|
|
# Include the component config parts for h5bp
|
2013-11-20 18:48:42 +01:00
|
|
|
include h5bp/h5bp.conf;
|
2012-02-03 13:58:16 +01:00
|
|
|
}
|