2019-02-01 13:04:01 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# | Config file for example.com host |
|
|
|
|
# ----------------------------------------------------------------------
|
2014-07-28 16:52:00 +02:00
|
|
|
#
|
2019-02-01 13:04:01 +01:00
|
|
|
# This file is a template for a nginx server.
|
|
|
|
# This nginx server listen the `example.com` host and handle requests.
|
|
|
|
# Remplace `example.com` with your hostname before enabling.
|
2014-07-28 16:52:00 +02:00
|
|
|
|
2019-02-01 13:04:01 +01:00
|
|
|
# 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
|
2014-07-28 16:52:00 +02:00
|
|
|
server {
|
2016-05-25 15:02:34 +02:00
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
listen 443 ssl http2;
|
2014-07-28 16:52:00 +02:00
|
|
|
|
|
|
|
server_name www.example.com;
|
|
|
|
|
2018-11-25 19:13:33 +01:00
|
|
|
include h5bp/ssl/ssl_engine.conf;
|
2019-02-01 13:04:01 +01:00
|
|
|
include h5bp/ssl/certificate_files.conf;
|
2018-11-25 19:13:33 +01:00
|
|
|
include h5bp/ssl/policy_intermediate.conf;
|
2014-07-28 16:52:00 +02:00
|
|
|
|
2019-02-01 13:04:01 +01:00
|
|
|
return 301 $scheme://example.com$request_uri;
|
2014-07-28 16:52:00 +02:00
|
|
|
}
|
|
|
|
|
2015-04-01 23:10:30 +02:00
|
|
|
|
2019-02-01 13:04:01 +01:00
|
|
|
server {
|
2016-05-25 15:02:34 +02:00
|
|
|
# listen [::]:443 ssl http2 accept_filter=dataready; # for FreeBSD
|
|
|
|
# listen 443 ssl http2 accept_filter=dataready; # for FreeBSD
|
|
|
|
# listen [::]:443 ssl http2 deferred; # for Linux
|
|
|
|
# listen 443 ssl http2 deferred; # for Linux
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
listen 443 ssl http2;
|
2014-07-28 16:52:00 +02:00
|
|
|
|
|
|
|
# The host name to respond to
|
|
|
|
server_name example.com;
|
|
|
|
|
2018-11-25 19:13:33 +01:00
|
|
|
include h5bp/ssl/ssl_engine.conf;
|
2019-02-01 13:04:01 +01:00
|
|
|
include h5bp/ssl/certificate_files.conf;
|
2018-11-25 19:13:33 +01:00
|
|
|
include h5bp/ssl/policy_intermediate.conf;
|
2014-07-28 16:52:00 +02:00
|
|
|
|
|
|
|
# Path for static files
|
2014-10-01 12:03:49 +02:00
|
|
|
root /var/www/example.com/public;
|
2014-07-28 16:52:00 +02:00
|
|
|
|
|
|
|
# Custom 404 page
|
|
|
|
error_page 404 /404.html;
|
|
|
|
|
|
|
|
# Include the basic h5bp config set
|
|
|
|
include h5bp/basic.conf;
|
|
|
|
}
|