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

How to serve internal site on non-default root path? #55

Open
neocogent opened this issue Feb 28, 2023 · 1 comment
Open

How to serve internal site on non-default root path? #55

neocogent opened this issue Feb 28, 2023 · 1 comment

Comments

@neocogent
Copy link

neocogent commented Feb 28, 2023

I'm trying to serve lnme with nginx as reverse proxy. I've set it so that a path url like

test.home.kg/pmt/

gets passed to back end at localhost:1323 (the default).

This proxy works but only when as root of the domain. If I add in the /pmt prefix then the internal site isn't served. Instead it serves a <pre></pre> block with links to referenced files, eg. js, css, svg on page.

I can get around this by using a new port and having it serve as root. And I gather I could copy the internal default files and put them in a server path and use that as "external" site.

But I'm trying to see if there is a shortcut or setting that allows serving the embedded site on a non-root path? This allows a wee bit simpler integration of page into a cluster of other pages on my site.

edit: I wanted to add... by editing the nginx proxy_pass directive to have a trailing slash I could get the main page to serve but when a test "send" is done it does not complete. It seems to be the invoice is directed to a /v1/ prefix and that is not handled well when not at root. eg. this is my relevant nginx conf:

location /pmt/ { proxy_pass http://127.0.0.1:1323/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

@bumi
Copy link
Owner

bumi commented Mar 2, 2023

ah I see. good point.
I think we should use relative paths in the app or make the root domain/path configurable.

we could probably try to add the path here: https://github.com/bumi/lnme/blob/master/files/assets/lnme.js#L58

or dynamically add a data-lnmeBaseUrl ="https://example.com/full/path/" here:
https://github.com/bumi/lnme/blob/master/files/root/index.html#L154

do you want to try this?

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

2 participants