Red-Dashboard
Red-Dashboard copied to clipboard
reverse proxy path support
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