-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx-ip-https.conf
More file actions
29 lines (26 loc) · 921 Bytes
/
Copy pathnginx-ip-https.conf
File metadata and controls
29 lines (26 loc) · 921 Bytes
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
29
# Put this file in your nginx site configuration, then replace the certificate
# paths and public IP. Keep Next.js bound only to 127.0.0.1:3000.
server {
listen 80;
server_name YOUR_PUBLIC_IP;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name YOUR_PUBLIC_IP;
ssl_certificate /root/cert/ip/fullchain.pem;
ssl_certificate_key /root/cert/ip/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
add_header Strict-Transport-Security "max-age=31536000" always;
client_max_body_size 8m;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}