mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Rework nginx file again for link previews
This commit is contained in:
parent
2f2fda2ac3
commit
15c46ec3f0
1 changed files with 4 additions and 21 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue