-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx-static-server-https.conf
More file actions
28 lines (24 loc) · 1.04 KB
/
Copy pathnginx-static-server-https.conf
File metadata and controls
28 lines (24 loc) · 1.04 KB
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
# Nginx configuration file for a static HTML server on port 443 (through HTTPS with Let's Encrypt)
# HTTP Server (redirect to HTTPS)
server {
listen 80;
server_tokens off;
server_name mysite.org www.mysite.org; # Customize the target subdomains
return 301 https://mysite.org$request_uri;
}
# HTTPS Server
server {
listen 443 ssl;
server_tokens off;
server_name mysite.org www.mysite.org; # Customize the target subdomains
error_log /var/log/nginx/mysite.error.log warn; # Customize the error log location
root /home/myuser/html; # Customize the static files' location
index index.html;
try_files $uri /index.html;
ssl_certificate /etc/letsencrypt/live/mysite.org/fullchain.pem; # Customize certificate location
ssl_certificate_key /etc/letsencrypt/live/mysite.org/privkey.pem; # Customize certificate location
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_session_timeout 5m;
}