mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
caching medias and static files
This commit is contained in:
parent
a579c20bfe
commit
4daca9672e
1 changed files with 40 additions and 22 deletions
|
@ -14,6 +14,12 @@ location __PATH__/ {
|
||||||
#Default indexes and catch-all
|
#Default indexes and catch-all
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
|
# tell friendica that it is behind a reverse proxy
|
||||||
|
# https://wiki.friendi.ca/docs/install#optional_reverse-proxying_and_https
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
# make sure webfinger and other well known services aren't blocked
|
# make sure webfinger and other well known services aren't blocked
|
||||||
# by denying dot files and rewrite request to the front controller
|
# by denying dot files and rewrite request to the front controller
|
||||||
location ^~ /.well-known/ {
|
location ^~ /.well-known/ {
|
||||||
|
@ -40,6 +46,18 @@ location __PATH__/ {
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# cache medias
|
||||||
|
location ~* (/images/|/photo/) {
|
||||||
|
# 604800 = 1 week
|
||||||
|
more_set_headers "Cache-Control: private, immutable, max-age=604800";
|
||||||
|
}
|
||||||
|
|
||||||
|
# cache static files
|
||||||
|
location /static/ {
|
||||||
|
# 300 = 5 minutes
|
||||||
|
more_set_headers "Cache-control: public, max-age=300";
|
||||||
|
}
|
||||||
|
|
||||||
# deny access to all dot files
|
# deny access to all dot files
|
||||||
location ~ /\. {
|
location ~ /\. {
|
||||||
deny all;
|
deny all;
|
||||||
|
|
Loading…
Add table
Reference in a new issue