Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse proxy path support #55

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fixator10
Copy link
Contributor

@fixator10 fixator10 commented Jan 23, 2021

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

Type

  • Bugfix
  • Enhancement
  • 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 fixator10 marked this pull request as draft January 23, 2021 23:13
@fixator10 fixator10 marked this pull request as ready for review January 24, 2021 06:22
@NeuroAssassin NeuroAssassin added the hacktoberfest-accepted Used to mark a PR as valid Hacktoberfest contribution. DO NOT REMOVE UNTIL END OF NOVEMBER (sic!)! label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Used to mark a PR as valid Hacktoberfest contribution. DO NOT REMOVE UNTIL END OF NOVEMBER (sic!)!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants