mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
Update nginx.conf
This commit is contained in:
parent
0b04576057
commit
5ebca792a7
1 changed files with 17 additions and 57 deletions
|
@ -1,65 +1,25 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
proxy_pass http://127.0.0.1:__PORT__;
|
||||||
alias __FINALPATH__/ ;
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_redirect off;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
# For WebSocket
|
||||||
#client_max_body_size 50M;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
|
||||||
# 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;
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
|
||||||
}
|
|
||||||
|
|
||||||
# do not log periodic polling requests from logged in users
|
|
||||||
location /api/updates/ {
|
|
||||||
access_log off;
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
|
||||||
}
|
|
||||||
|
|
||||||
try_files $uri $uri/ index.php;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
### End of PHP configuration part
|
|
||||||
|
|
||||||
|
# Cache settings
|
||||||
|
#proxy_cache cache1;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
proxy_cache_use_stale updating;
|
||||||
|
more_set_headers "X-Cache: $upstream_cache_status";
|
||||||
|
# Change to upload limit
|
||||||
|
client_max_body_size 80m;
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue