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

check if the upstream is a placeholder #3819

Merged
merged 2 commits into from Oct 29, 2020

Conversation

jasonmccallister
Copy link
Contributor

@jasonmccallister jasonmccallister commented Oct 24, 2020

This removes the hard coded port 80 when the reverse_proxy upstream is using a placeholder.

Here is an example Caddyfile to reproduces the issue:

my.domain.com {
    encode zstd gzip

    some_module_that_sets_the_http_var

    respond /test 200 { # works as expected
    	body {http.vars.some_custom_var}
    	close
    }

    tls internal

    reverse_proxy / {
        to {http.vars.some_custom_var}
    }

    file_server
}

More detailed explanations are documented in this conversation: https://caddy.community/t/dynamically-set-reverse-proxy-upstreams-from-custom-module/10142/15

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually couldn't think of a better way to do this... but I just want a comment here to explain why this condition is what it is.

Thanks!

modules/caddyhttp/reverseproxy/caddyfile.go Show resolved Hide resolved
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, thank you for the fix! I will merge this in a moment.

@mholt mholt merged commit c9fdff9 into caddyserver:master Oct 29, 2020
@mholt mholt added this to the v2.3.0 milestone Oct 29, 2020
@francislavoie francislavoie added the bug 🐞 Something isn't working label Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants