Last active
April 27, 2025 20:23
-
-
Save Ozerich/02a324bbaed16dcf258d8b662e2c2e13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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