server-configs-nginx/conf.d/templates/no-ssl.example.com.conf

39 lines
1.1 KiB
Nginx Configuration File
Raw Normal View History

# ----------------------------------------------------------------------
# | Config file for non-secure example.com host |
# ----------------------------------------------------------------------
#
2019-05-14 19:02:21 +02:00
# This file is a template for a non-secure Nginx server.
# This Nginx server listens for the `example.com` host and handles requests.
2019-04-14 19:31:05 +02:00
# Replace `example.com` with your hostname before enabling.
# Choose between www and non-www, listen on the wrong one and redirect to
# the right one.
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#server-name-if
server {
listen [::]:80;
listen 80;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
# listen [::]:80 accept_filter=httpready; # for FreeBSD
# listen 80 accept_filter=httpready; # for FreeBSD
listen [::]:80;
listen 80;
# The host name to respond to
server_name example.com;
# Path for static files
root /var/www/example.com/public;
# Custom error pages
include h5bp/errors/custom_errors.conf;
# Include the basic h5bp config set
include h5bp/basic.conf;
}