30 lines
733 B
Plaintext
30 lines
733 B
Plaintext
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
server_name netoik.io;
|
||
|
|
||
|
# Configure secure access.
|
||
|
ssl_certificate /etc/letsencrypt/live/netoik.io/fullchain.pem;
|
||
|
ssl_certificate_key /etc/letsencrypt/live/netoik.io/privkey.pem;
|
||
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||
|
|
||
|
# Redirect to homepage.
|
||
|
return 301 https://www.netoik.io$request_uri;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
server_name netoik.io;
|
||
|
|
||
|
# Let access to certbot challenge files.
|
||
|
location /.well-known/acme-challenge/ {
|
||
|
root /var/www/;
|
||
|
}
|
||
|
|
||
|
# Redirect to homepage.
|
||
|
return 301 https://www.netoik.io$request_uri;
|
||
|
}
|