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

subdirectory with nginx proxypass #46

Closed
randomessence opened this issue Sep 14, 2013 · 9 comments
Closed

subdirectory with nginx proxypass #46

randomessence opened this issue Sep 14, 2013 · 9 comments

Comments

@randomessence
Copy link

How would you use haste-server in a sub-directory? I can use it in the root of the WWW using proxypass to remove to port from the URL. Though if i try to use it in a sub-directory like location /haste problems start appearing.

@seejohnrun
Copy link
Contributor

Currently not supported due to https://github.com/seejohnrun/haste-server/blob/master/server.js#L113
Would be easy to add a root_path param to config

@randomessence
Copy link
Author

Thanks. I will try that.

@Grimeton
Copy link

As it turns out: it works.

I patched it but the patch didn't go down the way it should.

On the client side the subdirectory becomes part of the key that is used to handle the file. So instead of "$key" you get something like "subdirectory/$key" which is kinda annoying and can only be fixed by changing the routes in the main server. They have to be change anyway to support "$subdir/$key" but in the end they need to support "$subdir/$subdir/$key" because of the mess that happens on the client side.

It's also a problem to get the new subfolder to the client part without patching stuff. I had to patch the application.js file to make the requests go to the right place.

So far it doesn't seem easy to just add a root_path variable.

Any hints or tips that could help me to implement it and I'm offering the patch :)

KR,

G.

@seejohnrun
Copy link
Contributor

Thanks for the update @Grimeton - you can follow along with #53 for updates on subdirectory modifications (should be done soon)

@thorn1976
Copy link

I really like the haste-server, but the lacking subdirectory support unfortunately is a show-stopper in my environment. Are there any plans on supporting subdirectories soon?

@cgelici
Copy link

cgelici commented Oct 31, 2014

I'm trying to get haste-server working with a lighttpd reverse proxy. What I want is to browse to 'mydomain.com/p/' where my haste-server will greet me.

I have the following set up:

$HTTP["url"] =~ "^/p/" {
proxy.server = (
"" => (
(
"host" => "",
"port" =>
)
)
)
}

Where myhost and port are set properly. With this enabled I get a partial response. Meaning, I only receive the title of the page, and nothing else. Can anyone help me with this ?

@tmiklas
Copy link

tmiklas commented Nov 9, 2014

Problem sorted - I've described how to do it at http://www.ctrl-alt-del.cc/2014/11/haste-server-base-url-hackpatch.html with working configs for HAProxy, Lighttpd, Nginx and Apache.
Pull request coming up of course.

@kolargol
Copy link

anything new in this topic? Is subdir enabled so we can put it behind proxy ?

@seejohnrun
Copy link
Contributor

I'll try to get something together this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants