-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
28 lines (25 loc) · 1013 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# HTTPS server for timweber.name.
server {
server_name timweber.name;
# This include will exist on my server as soon as the Let's Encrypt cert has been retrieved automatically.
# It contains a "listen 443 ssl" and other SSL paths and options. As long as it does not exist, certbot
# can use this server block to provide the HTTP challenge response.
include /etc/nginx/letsencrypt-snippet.active[.]conf;
location / {
root /srv/www/timweber.name/public;
}
}
# Redirect timweber.name (HTTP) to HTTPS.
# nginx will ignore this block if the one above doesn't have SSL configured, since server_name and port will conflict.
server {
listen 80;
server_name timweber.name;
return 301 https://timweber.name$request_uri;
}
# Additional redirects for www.timweber.name and (www.)tim-weber.name, with and without HTTPS.
server {
listen 80;
server_name www.timweber.name tim-weber.name www.tim-weber.name;
include /etc/nginx/letsencrypt-snippet.active[.]conf;
return 301 https://timweber.name$request_uri;
}