2022-04-29 12:18:34 +02:00
|
|
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
|
|
location __PATH__/ {
|
|
|
|
|
|
|
|
# Path to source
|
|
|
|
alias __FINALPATH__/ ;
|
|
|
|
|
|
|
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
|
|
|
#client_max_body_size 50M;
|
|
|
|
|
2022-12-22 21:07:48 +01:00
|
|
|
|
|
|
|
# store responses to anonymous users for up to 1 minute
|
|
|
|
proxy_cache bookwyrm_cache;
|
|
|
|
proxy_cache_valid any 1m;
|
|
|
|
add_header X-Cache-Status $upstream_cache_status;
|
|
|
|
|
|
|
|
# ignore the set cookie header when deciding to
|
|
|
|
# store a response in the cache
|
|
|
|
proxy_ignore_headers Cache-Control Set-Cookie Expires;
|
|
|
|
|
|
|
|
# PUT requests always bypass the cache
|
|
|
|
# logged in sessions also do not populate the cache
|
|
|
|
# to avoid serving personal data to anonymous users
|
|
|
|
proxy_cache_methods GET HEAD;
|
|
|
|
proxy_no_cache $cookie_sessionid;
|
|
|
|
proxy_cache_bypass $cookie_sessionid;
|
|
|
|
|
|
|
|
# tell the web container the address of the outside client
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) {
|
|
|
|
limit_req zone=loginlimit;
|
2022-12-22 21:14:43 +01:00
|
|
|
proxy_pass http://127.0.0.1:__PORT__;
|
2022-12-22 21:07:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# do not log periodic polling requests from logged in users
|
|
|
|
location /api/updates/ {
|
|
|
|
access_log off;
|
2022-12-22 21:14:43 +01:00
|
|
|
proxy_pass http://127.0.0.1:__PORT__;
|
2022-12-22 21:07:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__;
|
|
|
|
}
|
|
|
|
|
2022-04-29 12:18:34 +02:00
|
|
|
try_files $uri $uri/ index.php;
|
2022-12-22 21:07:48 +01:00
|
|
|
location ~ ^/(images|static)/ {
|
|
|
|
root /app;
|
|
|
|
try_files $uri =404;
|
|
|
|
add_header X-Cache-Status STATIC;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
|
|
|
|
# monitor the celery queues with flower, no caching enabled
|
|
|
|
location /flower/ {
|
|
|
|
proxy_pass http://flower:8888;
|
|
|
|
proxy_cache_bypass 1;
|
|
|
|
}
|
|
|
|
|
2022-04-29 12:18:34 +02:00
|
|
|
### End of PHP configuration part
|
|
|
|
|
|
|
|
# Include SSOWAT user panel.
|
|
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
|
|
}
|