getgrav / getgrav/grav

custom_rewrite_base behind Loadbalancer

Open
#1,981 4 comments 0 reactions 0 assignees View on GitHub
in progress
Dominant language
PHP
Stars
15.7k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
12

Description

Hello there

I am trying to integrate grav in our company. But I am having issues with Grav being a Backend of a Load Balancer.

So I am trying to call grav via. www.example.com/doku (backend is defined with Port 80 to Grav Host). If I do this, I get Grav but without any assets loaded (css, js). So not really what I am looking for.

After that I try the option **custom_base_url** under user/config/system.yaml. As Key and Value I configured:

`custom_base_url: doku/`

With that option being set, all assets of Grav could be loaded. And it looks as it should. But while navigating through pages I get Links like these:

1. Destination: Home -> https://www.example.com/doku/ ; OK
2. Destination: toppage1_subpage -> https://www.example.com/doku/doku/toppage1/subpage-> 404
3. Destination: toppage2 -> https://www.example.com/doku/doku/toppage1/doku/toppage2 -> 404
4. Destination: toppage1_subpage2 -> https://www.example.com/doku/doku/toppage1/doku/toppage1/subpage2

So it's always adding /doku to each request. But it should be :

1. Destination: Home -> https://www.example.com/doku/ ; OK
2. Destination: toppage1_subpage -> https://www.example.com/doku/toppage1/subpage-> OK
3. Destination: toppage2 -> https://www.example.com/doku/toppage2 -> Ok

I need a custom_base_url that is placed just in front of the page hierarchie:
https://www.example.com/{CUSTOM_BASE_URL}/any-ath

Now simply asked:
How can I access Grav through www.example.com/doku with all it's content and assets..

Thanks in advance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.