45 lines
1.4 KiB
Plaintext
45 lines
1.4 KiB
Plaintext
proxy_cache_path /tmp/proxy-media-cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off;
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name example.com;
|
|
|
|
client_max_body_size 20m;
|
|
|
|
location / {
|
|
proxy_pass http://192.168.1.105:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_redirect off;
|
|
|
|
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;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
# Caching
|
|
proxy_cache cache1;
|
|
proxy_cache_lock on;
|
|
proxy_cache_use_stale updating;
|
|
add_header X-Cache $upstream_cache_status;
|
|
}
|
|
|
|
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name example.com;
|
|
|
|
root /var/lib/nginx/html;
|
|
location /.well-known/acme-challenge/ { allow all; }
|
|
location /.well-known/pki-validation/ { allow all; }
|
|
location / { return 301 https://$server_name$request_uri; }
|
|
}
|