1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kresus_ynh.git synced 2024-09-03 19:36:10 +02:00

Merge pull request #25 Add file caching+gzip

Add file caching+gzip
This commit is contained in:
Jean-Baptiste 2019-01-23 21:04:11 +01:00 committed by GitHub
commit f7b472599b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 12 deletions

View file

@ -1,17 +1,27 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__; alias __FINALPATH__/build/client/;
proxy_set_header Host $host; try_files $uri $uri/index.html @kresus;
proxy_redirect off;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
# allow "big" imports
client_max_body_size 8M;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }
location ~ __PATH__/\.(css|js|png|jpe?g|svg|eot|woff2?)$ {
add_header Cache-Control 'max-age=2592000, must-revalidate, public';
gzip_types text/plain text/css application/javascript text/javascript;
gzip on;
try_files $uri $uri/index.html @kresus;
}
location @kresus {
client_max_body_size 8M;
send_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off;
}

View file

@ -15,7 +15,7 @@
"requirements": { "requirements": {
"yunohost": ">= 2.7.14" "yunohost": ">= 2.7.14"
}, },
"version": "0.13.3~ynh1", "version": "0.13.3~ynh2",
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx" "nginx"