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

use alternative http/https port and add multiple auth accounts #605

Closed
monkey-jsun opened this issue Dec 13, 2023 · 4 comments
Closed

use alternative http/https port and add multiple auth accounts #605

monkey-jsun opened this issue Dec 13, 2023 · 4 comments

Comments

@monkey-jsun
Copy link

I followed the readme.md file and got everything up and running. Great! Thanks!

I like to venture to tweak a couple of things, but I'm having troubles.

The first challenge is to use alternative http/https ports(8080/8443). I added the following directives to the Caddyfile and caddy starts up fine with the designated high ports. However, when I open URL at http://<caddy.server>:8080, the browser redirects to https://<caddy.server>:443, instead of https://<caddy.server>:8443. How do I achieve this?

{
        order forward_proxy before file_server
        https_port 8443
        http_port 8080
}
:8443, vpn.my.net {
        tls [email protected]
        forward_proxy {
                basic_auth user password
                hide_ip
                hide_via
                probe_resistance
        }
        file_server {
                root /var/www/html
        }
}

My second challenge is to add multiple user accounts. How do I do that?

BTW, I googled Caddyfile format and it seems quite different from what is used here. For example, forward_proxy would become forwardproxy, and basic_auth becomes basicauth. I'm quite lost.

@5l2
Copy link

5l2 commented Dec 14, 2023

For the first point, you should refer to the official Caddy documentation and inquire in the Caddy community.
Regarding the second point, you can refer to other relevant issues, such as #587.

@monkey-jsun
Copy link
Author

Thanks for the pointer. Do you know why the official Caddy document looks similar but not exactly the same? For example, in your example we use "basic_auth", but in the official Caddyfile document it uses "basicauth", which supports multiple users.

There are others that also fall into this strange "similar but different" category, such as forward_proxy vs forwardproxy.

@5l2
Copy link

5l2 commented Dec 15, 2023

Yes, because Caddy has two versions.
To be compatible with Caddy 2, the latest forwardproxy (caddy2 branch) indeed uses the forward_proxy and basic_auth directives, whereas the previous version (master branch) used forwardproxy and basicauth directives.

@klzgrad klzgrad closed this as completed Dec 16, 2023
@klzgrad
Copy link
Owner

klzgrad commented Feb 18, 2024

Multiple auth is fixed here https://github.com/klzgrad/forwardproxy/releases/tag/v2.7.6-naive

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

3 participants