xyproto/algernon

baseurl option for directory listings

basaran opened this issue · 2 comments

Hello,

I'm testing something with nginx in the front, and algernon at the back:

Here, yay is the algernon:

  upstream yay {
      server localhost:6000;
  }

  location /yay {
      proxy_pass http://yay/;
  }

This basically proxies the http://localhost/yay to algernon:6000, but it strips the /yay in the process of doing so. This works fine, but directory listings break.

Let's say I have a file:

http://localhost/file.png

If we had an option --baseurl, we could specify the /yay, it would be good. Since it's hard coded. Thank you for algernon.

Thanks for reporting!

Would it be enough if the links in the directory listing were updated to ie. start with /yay, or would other changes also be needed for this to work?

Hello, thank you for getting back. Yes, I think a simple static basepath to be issued during launch will address most use cases.

It should be called basepath by the way. I think.

But none the less, give me a few days to go back to this. I will test a few more cases where algernon itself is proxied through another.