Red-Dashboard icon indicating copy to clipboard operation
Red-Dashboard copied to clipboard

reverse proxy path support

Open fixator10 opened this issue 5 years ago • 0 comments

RE: #50, recreating, since i fucked up last one

Type

  • [ ] Bugfix
  • [x] Enhancement
  • [x] New feature

Description of the changes

support for reverse proxy under a path

Tested with nginx with next configs:

        location /dash/ {
                proxy_pass http://localhost:42356;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  # may be not required if real_ip is used
                proxy_set_header X-Scheme $scheme;
                proxy_set_header X-Script-Name /dash;
        }
        location /{
                proxy_pass http://localhost:42356;
        }

Should work on apache with next config:

<VirtualHost *:80>
    RewriteEngine on
    RewriteRule "^/dash$" "/dash/" [R,NC]
    <LocationMatch ^/dash/.*>
        ProxyPreserveHost On
        ProxyPass http://localhost:42356
        ProxyPassReverse http://localhost:42356
        RequestHeader set X-Script-Name "/dash"   
    </LocationMatch>
</VirtualHost>

thanks to @npc203 for help with testing apache Please, if you understand apache better, make this better

A small issue with #-links: when js is not "initialized" (2fast4this) they redirects to main dashboard's page (for example - commands categories will redirect to /dash/#Category instead of /dash/commands/#Category). Not sure how to fix that, if that even needs fixing

fixator10 avatar Jan 23 '21 22:01 fixator10