Skip to content

Instantly share code, notes, and snippets.

@Ozerich
Last active April 27, 2025 20:23
Show Gist options
  • Save Ozerich/02a324bbaed16dcf258d8b662e2c2e13 to your computer and use it in GitHub Desktop.
Save Ozerich/02a324bbaed16dcf258d8b662e2c2e13 to your computer and use it in GitHub Desktop.
atlantm.by {
handle_path /uploads/blog/* {
root * /srv/uploads/blog
file_server browse
}
handle {
reverse_proxy 127.0.0.1:3000
}
}
server {
listen 80;
server_name atlantm.by www.atlantm.by;
# Редиректим все на https
return 301 https://atlantm.by$request_uri;
}
server {
listen 443 ssl;
server_name atlantm.by;
ssl_certificate /etc/ssl/certs/atlantm.by.crt;
ssl_certificate_key /etc/ssl/private/atlantm.by.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# Если приходит с www — редиректим на без www
if ($host = 'www.atlantm.by') {
return 301 https://atlantm.by$request_uri;
}
location /uploads/blog/ {
root /srv;
autoindex on;
}
location / {
proxy_pass http://127.0.0.1:3000;
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 $scheme;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment