mailinabox/conf/nginx.conf

37 lines
797 B
Nginx Configuration File
Raw Permalink Normal View History

## $HOSTNAME
# Redirect all HTTP to HTTPS.
2013-09-01 14:24:49 +00:00
server {
listen 80;
listen [::]:80;
2013-09-01 14:24:49 +00:00
server_name $HOSTNAME;
root /tmp/invalid-path-nothing-here;
# Improve privacy: Hide version an OS information on
# error pages and in the "Server" HTTP-Header.
server_tokens off;
# Redirect using the 'return' directive and the built-in
# variable '$request_uri' to avoid any capturing, matching
# or evaluation of regular expressions.
return 301 https://$HOSTNAME$request_uri;
2013-09-07 20:53:25 +00:00
}
# The secure HTTPS server.
server {
listen 443 ssl;
listen [::]:443 ssl;
2013-09-01 14:24:49 +00:00
server_name $HOSTNAME;
2013-09-07 20:53:25 +00:00
# Improve privacy: Hide version an OS information on
# error pages and in the "Server" HTTP-Header.
server_tokens off;
ssl_certificate $SSL_CERTIFICATE;
ssl_certificate_key $SSL_KEY;
# ADDITIONAL DIRECTIVES HERE
2013-09-01 14:24:49 +00:00
}