mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-31 11:04:20 +01:00
Rework nginx file again for link previews
This commit is contained in:
@@ -31,31 +31,12 @@ server {
|
||||
|
||||
root /opt/ditto/public;
|
||||
|
||||
location @spa {
|
||||
try_files /index.html /dev/null;
|
||||
}
|
||||
|
||||
location @frontend {
|
||||
try_files $uri @ditto-static;
|
||||
}
|
||||
|
||||
location @ditto-static {
|
||||
root /opt/ditto/static;
|
||||
try_files $uri @spa;
|
||||
}
|
||||
|
||||
location /packs {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
root /opt/ditto/public;
|
||||
}
|
||||
|
||||
location /metrics {
|
||||
allow 127.0.0.1;
|
||||
deny all;
|
||||
proxy_pass http://ditto;
|
||||
}
|
||||
|
||||
location ~ ^/(instance|sw\.js$|sw\.js\.map$) {
|
||||
root /opt/ditto/public;
|
||||
try_files $uri =404;
|
||||
@@ -66,11 +47,13 @@ server {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ~ ^/(api|relay|oauth|manifest.json|nodeinfo|.well-known/(nodeinfo|nostr.json)) {
|
||||
location /metrics {
|
||||
allow 127.0.0.1;
|
||||
deny all;
|
||||
proxy_pass http://ditto;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files /dev/null @frontend;
|
||||
proxy_pass http://ditto;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user