mirror of
https://github.com/YunoHost-Apps/akkoma_ynh.git
synced 2024-09-03 20:36:17 +02:00
Fix (local) attached media proxy (#41)
* fix syntax * Bump version * Auto-update README * Update nginx.conf (#40) * Update nginx.conf Fix bug in which media was being scrubbed out by CSP * Use __PORT__ instead of fixed value --------- Co-authored-by: lapineige <lapineige@users.noreply.github.com> --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Twizzay <88040412+twizzay-code@users.noreply.github.com>
This commit is contained in:
parent
0dfe5667e2
commit
1dcd325856
1 changed files with 16 additions and 0 deletions
|
@ -36,6 +36,22 @@ location / {
|
|||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
||||
|
||||
rewrite ^/proxy/(.*)/(.*)/.* /proxy/$1/$2 last;
|
||||
|
||||
location ~ ^/(media|proxy) {
|
||||
proxy_cache akkoma_media_cache;
|
||||
proxy_cache_key $host$uri$is_args$args;
|
||||
proxy_http_version 1.1;
|
||||
proxy_cache_valid 200 206 301 304 1h;
|
||||
proxy_cache_lock on;
|
||||
proxy_ignore_client_abort on;
|
||||
proxy_buffering on;
|
||||
chunked_transfer_encoding on;
|
||||
# added some stuff that seirdy said to add to make me bullet proof. B-) https://akkoma.dev/AkkomaGang/akkoma/issues/547#issuecomment-9261
|
||||
more_set_headers "Content-Security-Policy : script-src 'none'; default-src 'none'; upgrade-insecure-requests; base-uri 'none'; form-action 'none'; 'sandbox';";
|
||||
|
||||
proxy_pass http://localhost:__PORT__;
|
||||
=======
|
||||
location ~ ^/(proxy|media) {
|
||||
more_set_headers "Content-Security-Policy : default-src 'none'; upgrade-insecure-requests; sandbox;";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue