Set context path? - Rib

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sergiu

I am trying to host neuron through rib. Hosting it on the base url works fine however I would like to have it at https://<domain>/neuron. This does not currently work yielding "File not Found" in Firefox. I assume it has something to do with setting the proper context path to either rib or shake however by knowledge of Haskell is very limited. Can you help?

Sridhar Ratnakumar

Do you have an URL to share ?

Sergiu

neuron is on my home pc which connects to a proxy. The proxy forwards all requests to the local port

Sergiu

If requests are directly sent to / and not /neuron, it works fine. From my experience with airsonic, this is usually solved by giving a context path to the application. I'm wondering if there is such a thing for rib.

Sridhar Ratnakumar

@Sergiu Are you trying to access the rib server? (neuron's rib -s command)

Sridhar Ratnakumar

rib server always services neuron notes at /

Sridhar Ratnakumar

But you don't need to be using the rib server

Sergiu

Yes. Server is generated with "neuron rib -wS"

Sergiu

How can I tell it to serve from /neuron?

Sridhar Ratnakumar

Just run neuron rib -w on your home pc. And then have nginx or something serve the generated files at .neuron/output. At whatever relative path you want like /neuron.

Sergiu

I know, but using rib seemed like the easiest way to host my zettelkasten. Host it on my own machine and use a reverse proxy to access it from anywhere in the world.

Sridhar Ratnakumar

Tip: you can open .neuron/output/index.html directly in your browser. All the URLs in it are relative.

Sridhar Ratnakumar

Okay. the rib server is mainly for local/development use.

Sridhar Ratnakumar

If you really want to expose it at /neuron, you should try the nginx middleman.

Sridhar Ratnakumar

https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

Configure NGINX as a reverse proxy for HTTP and other protocols, with support for modifying request headers and fine-tuned buffering of responses.
Sergiu

I see. I will just use nginx then to serve the static files in .neuron/output

Sridhar Ratnakumar

FWIW, I use nginx to serve some zettelkastens. But nginx refers directly to the generated directory (instead of talking to rib server). Something like: image.png

Sridhar Ratnakumar

So you can bypass rib, and just use .neuron/output/ in your nginx config