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

HTTP path issue #79

Open
manderso7 opened this issue Nov 15, 2016 · 5 comments
Open

HTTP path issue #79

manderso7 opened this issue Nov 15, 2016 · 5 comments

Comments

@manderso7
Copy link

This may be a simple issue, but it's beyond me currently. I'm trying to setup redbird to reverse proxy my docker services, which are seen when I start redbird. However, the paths aren't respected when I try the URL. For example, when I type domain.ext:8080/prn, I'm redirected to domain.ext:8080/userlogin, which is the page that plexrequests automatically diverts a user to. If I change the URL to domain.ext:8080/prn/userlogin, I get the page, minus the CSS for it, and the log says "no valid route found for the given source". I think I need some sort of "baseurl" function, but don't know how to manage that in the config. My config is below. Any assistance you can offer would be appreciated.

`var proxy = require('redbird')({
port: 8080,
});

// var redbird = require('redbird')({
// port: 8080,
// });

require('redbird')
.docker(proxy)
.register("domain.net/prn", 'rogueosb/plexrequestsnet');

require('redbird')
.docker(proxy)
.register("domain.net/nzb", 'linuxserver/nzbget');
`

@manast
Copy link
Member

manast commented Nov 15, 2016

I think you need this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

In order to debug this, check in chrome dev tools what urls are actually being generated by your application. Proxy is stateless, he just proxies one url to another, it does not do anything besides that.

@manderso7
Copy link
Author

ET http://manderso.net:8080/Content/bootstrap.css userlogin:15 GET http://manderso.net:8080/Content/font-awesome.css userlogin:16 GET http://manderso.net:8080/Content/pace.min.css userlogin:17 GET http://manderso.net:8080/Content/awesome-bootstrap-checkbox.css userlogin:18 GET http://manderso.net:8080/Content/base.css?v=1.9.7 userlogin:19 GET http://manderso.net:8080/Content/Themes/plex.css?v=1.9.7 userlogin:21 GET http://manderso.net:8080/Content/jquery-2.2.1.min.js userlogin:20 GET http://manderso.net:8080/Content/tooltip/tooltipster.bundle.min.css userlogin:22 GET http://manderso.net:8080/Content/handlebars.min.js userlogin:23 GET http://manderso.net:8080/Content/bootstrap.min.js userlogin:24 GET http://manderso.net:8080/Content/bootstrap-notify.min.js userlogin:25 GET http://manderso.net:8080/Content/site.js?v=1.9.7 userlogin:26 GET http://manderso.net:8080/Content/pace.min.js userlogin:27 GET http://manderso.net:8080/Content/jquery.mixitup.js userlogin:28 GET http://manderso.net:8080/Content/moment.min.js userlogin:29 GET http://manderso.net:8080/Content/tooltip/tooltipster.bundle.min.js userlogin:22 GET http://manderso.net:8080/Content/handlebars.min.js userlogin:23 GET http://manderso.net:8080/Content/bootstrap.min.js userlogin:24 GET http://manderso.net:8080/Content/bootstrap-notify.min.js userlogin:25 GET http://manderso.net:8080/Content/site.js?v=1.9.7 userlogin:26 GET http://manderso.net:8080/Content/pace.min.js userlogin:27 GET http://manderso.net:8080/Content/jquery.mixitup.js userlogin:28 GET http://manderso.net:8080/Content/moment.min.js userlogin:29 GET http://manderso.net:8080/Content/tooltip/tooltipster.bundle.min.js

Once I enter manderso.net:8080/prn, the server redirects to the root of the plexrequestsnet application.
I've also tried adding ROOT_URL="http://localhost/prn" to the environment config for the container, which didn't help. According to this area's comment on this page, Ombi-app/Ombi#199, adding proxy_pass http://localhost:3579/request;
to the proxy config may help. How would I add that to the redbird config file? Thanks again for your help.

@manderso7
Copy link
Author

now trying a new docker image, from linuxserver/plexrequests. It says to add an environment variable of URL_BASE=/directory to the environment, which is what I've done. When I start the docker container, I can get to it using host:3000/prn, but when I use redbird, I get a 404 w/ manderso.net/prn. When i use manderso.net:3000/prn, the page comes up fine, css and all. Why wouldn't the specified port be passing? This is my current config:
`var proxy = require('redbird')({
port: 80,
});

// var redbird = require('redbird')({
// port: 8080,
// });

require('redbird')
.docker(proxy)
.register("manderso.net/prn", 'linuxserver/plexrequests');
`

@MartinMuzatko
Copy link

I have a similar problem. Paths are relative, so this should be fine.
App runs on :8080, reverse proxy routes to :80/cockpit

image

What am I doing wrong?

@MartinMuzatko
Copy link

I found the culprit.

usually when you create a static express server, the path is interpreted as a folder.
Of course, that only works if the path ends with a slash: localhost/app/

Unfortunately, redbird does not support that as of now, so this does not work:

proxy.register('localhost/app/', 'localhost:8080')

I found my way around this problem by using subdomains.

proxy.register('app.localhost', 'localhost:8080')

Best,
Martin

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

3 participants