Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Allow to run under subpath with reverse proxy #43

Closed
riaanp78 opened this issue Feb 13, 2023 · 6 comments
Closed

Allow to run under subpath with reverse proxy #43

riaanp78 opened this issue Feb 13, 2023 · 6 comments

Comments

@riaanp78
Copy link

Love this project! trying to setup a reverse proxy using sub directory. Was wondering if mailwhale supports it?

This is the config I am using:

    location /mailwhale/ {
        proxy_pass http://127.0.0.1:3005;
        proxy_set_header Host iot.rplab.xyz;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

    }

Any hints?

@muety
Copy link
Owner

muety commented Feb 13, 2023

Looks about right. What specific errors are you getting with that config?

@riaanp78
Copy link
Author

no errors. everything starts up fine. I can access it directly from it's port (works) , but via reverse proxy I get a blank page

image

Using webconsole it looks like it is trying to load files from the root file system e.g. / instead of /mailwhale/

@muety
Copy link
Owner

muety commented Feb 14, 2023

I think I'll have to implement a few tweaks to support being reverse-proxied under a subpath. Probably similar to this:

https://github.com/muety/wakapi/blob/master/views/head.tpl.html

https://github.com/muety/wakapi/blob/master/routes/routes.go#L47

https://github.com/muety/wakapi/blob/master/config/config.go#L124

I'll keep you posted.

@muety muety changed the title nginx reverse proxy Allow to run under subpath with reverse proxy Feb 14, 2023
@muety muety self-assigned this Feb 14, 2023
@riaanp78
Copy link
Author

Thank you! Not strictly required, but great if it could.

@muety
Copy link
Owner

muety commented Feb 26, 2023

Added support for running behind reverse proxy under a subpath ✔️ Check README for instructions.

@muety muety closed this as completed Feb 26, 2023
@riaanp78
Copy link
Author

Thank you so much. Will check it out

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants