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

Redirection to localhost #61

Closed
xaltsc opened this issue Jul 11, 2019 · 3 comments
Closed

Redirection to localhost #61

xaltsc opened this issue Jul 11, 2019 · 3 comments

Comments

@xaltsc
Copy link

xaltsc commented Jul 11, 2019

Hey,

I have a freshly new installed instiki on my server which I serve through Caddy using the following rule:

notes.website.com {
        tls mail@website.com
        gzip
        proxy / localhost:2500
}

However, for most of the pages I go to, especially the first configuration page, I get redirected to http://localhost:2500/.... instead of http://notes.website.com/.....

I tried to find a relevant setting for that, but it doesn't appear to exist.

I'm running the latest release.

@distler
Copy link
Collaborator

distler commented Jul 11, 2019

I am unfamiliar with Caddy, but I have run Instiki behind a reverse-proxy (using Apache). It works fine. In such a setup, Instiki does not know (and is not supposed to know) that it is running behind a reverse-proxy.

Check the HTML source of the page in question. You should find that Instiki has generated relative URLs (of the form '/wiki/show/Foo'). These should work properly in a reverse-proxy situation.

@xaltsc
Copy link
Author

xaltsc commented Jul 11, 2019

These work, but for instance, when I just go the website.com, I get redirected to http://localhost:2500/lab/show/HomePage instead of http://website.com/lab/show/HomePage

@xaltsc
Copy link
Author

xaltsc commented Jul 11, 2019

So yeah, Caddy was misconfigured. Changing the rule to the following solves the issue:

notes.website.com {
        tls mail@website.com
        gzip
        proxy / localhost:2500 {
                header_upstream X-Forwarded-Proto {scheme}
		header_upstream X-Forwarded-For {remote}
		header_upstream Host {host}
        }
}

I'm not sure it is a minimal working example, but it works.

@xaltsc xaltsc closed this as completed Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants