nginx: renaming @proxy block to @mastodon

If multiple sites are hosted on server, a common `@proxy` block
name may cause a conflict if another site uses a block with
same name.
This commit is contained in:
Izorkin 2024-09-02 23:24:48 +03:00
parent e8a75694cf
commit e204c306cd
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09

6
dist/nginx.conf vendored
View File

@ -67,11 +67,11 @@ server {
location / {
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
try_files $uri @proxy;
try_files $uri @mastodon;
}
# If Docker is used for deployment and Rails serves static files,
# then needed must replace line `try_files $uri =404;` with `try_files $uri @proxy;`.
# then needed must replace line `try_files $uri =404;` with `try_files $uri @mastodon;`.
location ^~ /assets/ {
add_header Cache-Control "public, max-age=2419200, must-revalidate";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
@ -141,7 +141,7 @@ server {
tcp_nodelay on;
}
location @proxy {
location @mastodon {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;