mirror of
https://github.com/sergeyyarkov/digital-store.git
synced 2026-10-11 18:29:11 +03:00
44 lines
961 B
Plaintext
44 lines
961 B
Plaintext
limit_req_zone $request_uri zone=by_uri:10m rate=300r/m;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name domain.ru;
|
|
server_tokens off;
|
|
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name domain.ru;
|
|
server_tokens off;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/domain.ru/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/domain.ru/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location / {
|
|
limit_req zone=by_uri burst=20 nodelay;
|
|
proxy_pass http://nodejs:3000;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
if ($host !~* ^(domain.ru)$ ) {
|
|
return 444;
|
|
}
|
|
}
|