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

WriteFreely only runs on domain root #714

Open
rowdypixel opened this issue Jun 12, 2023 · 2 comments
Open

WriteFreely only runs on domain root #714

rowdypixel opened this issue Jun 12, 2023 · 2 comments

Comments

@rowdypixel
Copy link

Describe the bug

When running WriteFreely behind a reverse proxy, I configured the proxy to only for the /blog subfolder on my domain. I added https://example.com/blog to config.ini as host, but it still assumes that I am running it on the root. For example, when I make it password protected it redirects me to example.com/login instead of example.com/blog/login upon visiting the home page.

Steps to reproduce (if necessary)

Steps to reproduce the behavior:

  1. Run WriteFreely
  2. Configure your reverse proxy server to only run on a folder of the domain. I am using Caddy, so my config looks like:
example.com:443 {
        root * /var/www/example.com
        encode gzip
        file_server
        reverse_proxy /blog* http://127.0.0.1:8003  
}
  1. Attempt to visit the site.

Expected behavior

The application should use the entire host string to generate its URLs instead of just the host.

Application configuration

  • Single mode
  • Database? sqlite
  • Open registration? no
  • Federation enabled? no

Version or last commit:
0.13.2

@thebaer
Copy link
Member

thebaer commented Jun 30, 2023

Thanks for mentioning this -- it's also been brought up on our forum. Would you be interested in submitting a fix for this?

@elkcityhazard
Copy link
Contributor

elkcityhazard commented Feb 29, 2024

I will try and implement this. I think the easiest way to do this would be to capture the bind and update the PathPrefix for the static routes and the main handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants