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

Add base url support #140

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Add base url support #140

merged 1 commit into from
Mar 6, 2023

Conversation

doodadjs
Copy link
Contributor

@doodadjs doodadjs commented Nov 16, 2016

Hi. A friend of mine asked for help to use your application with another base URL than root. I did it for him and now I'm sharing my changes to the community. There is only two files changed in the front end. The back end has not been touched. Don't forget to clear the cache of the browser before trying if you've already used it (I had this issue).

For the back end, you have to use a proxy server implementing a rewrite of the requested urls. See http://www.ctrl-alt-del.cc/2014/11/haste-server-base-url-hackpatch.html

I hope that it will work fine for you.

@KingDuckZ
Copy link

What's blocking this PR from being merged?

@seejohnrun
Copy link
Contributor

@KingDuckZ @doodadjs I think the requirement to use a proxy server is an issue. I'd prefer if we could get a solution that would for the server-side as well. The issue there is that there's currently no data passed between the two layers. I've started on a branch to do this, but I'm not ready to merge it yet. If someone else is interested it shouldn't be too difficult to get going, but I don't want to bring in a feature (as much as I appreciate the work here) that's half complete.

Otherwise, I'd be down to take a look this weekend and try to get something that works for both cases.

@doodadjs
Copy link
Contributor Author

@seejohnrun I understand. I wanted to touch less code than possible, but that's not enough.

@RihanArfan
Copy link

This works so well for me while proxying via Nginx and I think would be beneficial for others.

@rubenwardy
Copy link

rubenwardy commented Jul 30, 2019

You should always deploy applications behind a reverse proxy in production - it allows the use of HTTPS, ratelimiting, caching, and fail2ban.

People who don't want to use reverse proxy can just not use a base URL. There's no need to use a base URL if you don't have a reverse proxy, because there is nothing else you can serve

zneix added a commit to zneix/haste-server that referenced this pull request Sep 5, 2020
Something that would solve relevant upstream issues/prs: toptal#53 toptal#140
@github-actions
Copy link

github-actions bot commented Mar 8, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 8, 2022
@filipechagas filipechagas added triage and removed stale labels Mar 8, 2022
@filipechagas
Copy link
Contributor

This is will probably fix #156 and fix #214

@IzMichael
Copy link

Any progress on merging this?

Copy link

@kry008 kry008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working changes, tested on Ngnix with http://base_url/customdir

@The-Epic
Copy link

The-Epic commented Mar 5, 2023

Any update on this?

@filipechagas filipechagas merged commit b52b394 into toptal:master Mar 6, 2023
gothictomato pushed a commit to gothictomato/haste-server that referenced this pull request Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants