From e81b32e9d48abf2d805f3a584e16697a8a76b252 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 31 Mar 2021 02:56:34 +0200 Subject: [PATCH] Several fixes --- conf/nginx.conf | 17 +++++++++-------- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ddef42a..99fedf6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,8 @@ more_set_headers "X-Frame-Options : ALLOWALL"; - ## - # Application - ## + +## +# Application +## location @api { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -15,7 +16,7 @@ location @api { proxy_read_timeout 10m; send_timeout 10m; - proxy_pass http://localhost:__PORT__; + proxy_pass http://127.0.0.1:__PORT__; } location / { @@ -37,14 +38,14 @@ location = /api/v1/videos/upload { # This data gets stored in /var/lib/nginx by default, so you may want to put this directory # on a dedicated filesystem. client_max_body_size 12G; # default is 1M - add_header X-File-Maximum-Size 8G always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) + more_set_headers "X-File-Maximum-Size : 8G always"; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) try_files /dev/null @api; } location ~ ^/api/v1/(videos|video-playlists|video-channels|users/me) { client_max_body_size 3M; # default is 1M - add_header X-File-Maximum-Size 2M always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) + more_set_headers "X-File-Maximum-Size : 2M always"; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size) try_files /dev/null @api; } @@ -61,7 +62,7 @@ location @api_websocket { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass http://localhost:__PORT__; + proxy_pass http://127.0.0.1:__PORT__; } location /socket.io { @@ -116,7 +117,7 @@ tcp_nodelay on; # don't buffer data sent, good for small data burs # Bypass PeerTube for performance reasons. Optional. # Should be consistent with client-overrides assets list in /server/controllers/client.ts location ~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png))$ { - add_header Cache-Control "public, max-age=31536000, immutable"; # Cache 1 year + more_set_headers "Cache-Control : public, max-age=31536000, immutable"; # Cache 1 year try_files __DATADIR__/client-overrides/$1 __FINALPATH__/client/dist/$1 @api; } diff --git a/scripts/install b/scripts/install index c99eedc..98434c2 100644 --- a/scripts/install +++ b/scripts/install @@ -169,7 +169,7 @@ chown -R "$app":"$app" $final_path pushd "$final_path" ynh_use_nodejs - sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8988d5b..a8d7517 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -246,7 +246,7 @@ chown -R "$app":"$app" $final_path pushd "$final_path" ynh_use_nodejs - sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd #=================================================