Skip to content

Commit

Permalink
fix links for hh redirect download
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Jan 16, 2025
1 parent 401da78 commit 61eab8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
23 changes: 6 additions & 17 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,6 @@ http {
proxy_set_header Host file-monitor.malcolm.local;
}

# extracted file download hedgehog redirect
location ~* ^/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_auth_rt.conf;
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
set $filereq $2;
rewrite ^/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
proxy_pass https://$upstream;
proxy_ssl_verify off;
proxy_set_header Host $1;
proxy_set_header X-Malcolm-Forward "/hh-extracted-files/$1";
}

# extracted files from dashboards link (because Dashboards is prepending its own prefix, we have to handle it)
location ~* ^/dashboards/app/extracted-files/(.*) {
set $forwarded_scheme $scheme;
Expand All @@ -205,12 +192,14 @@ http {
proxy_redirect off;
proxy_set_header Host file-monitor.malcolm.local;
}
location ~* ^/dashboards/app/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {

# extracted file download hedgehog redirect
location ~* ^/(dashboards/app/)?hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_auth_rt.conf;
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
set $filereq $2;
rewrite ^/dashboards/app/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
set $upstream $2:8006;
set $filereq $3;
rewrite ^/(dashboards/app/)?hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
proxy_pass https://$upstream;
proxy_ssl_verify off;
proxy_set_header Host $1;
Expand Down
23 changes: 6 additions & 17 deletions nginx/nginx_readonly.conf
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,6 @@ http {
proxy_set_header Host file-monitor.malcolm.local;
}

# extracted file download hedgehog redirect
location ~* ^/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
set $filereq $2;
# TODO: check, do i need is_args/args here?
rewrite ^/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
proxy_pass https://$upstream;
proxy_ssl_verify off;
proxy_set_header Host $1;
proxy_set_header X-Malcolm-Forward "/hh-extracted-files/$1";
}

# extracted files from dashboards link (because Dashboards is prepending its own prefix, we have to handle it)
location ~* ^/dashboards/app/extracted-files/(.*) {
set $forwarded_scheme $scheme;
Expand All @@ -166,12 +153,14 @@ http {
proxy_redirect off;
proxy_set_header Host file-monitor.malcolm.local;
}
location ~* ^/dashboards/app/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {

# extracted file download hedgehog redirect
location ~* ^/(dashboards/app/)?hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_auth_rt.conf;
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
set $filereq $2;
rewrite ^/dashboards/app/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
set $upstream $2:8006;
set $filereq $3;
rewrite ^/(dashboards/app/)?hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $filereq break;
proxy_pass https://$upstream;
proxy_ssl_verify off;
proxy_set_header Host $1;
Expand Down

0 comments on commit 61eab8b

Please sign in to comment.