Apigee Proxy passing same host header to target
up vote
1
down vote
favorite
I have a simple apigee proxy, but I can see in the trace an issue where the Host header going to the target contains the host of the proxy itself.
i.e. the target gets
Host: xx.apigeename.com
rather than:
Host: my.awsservername.com
The target is on a different domain to the proxy, so it means that the target server is improperly handling the request (404 in this case).
Why is it that Apigee might be sending the exact same host header and not transforming it?
I have tried to explicitly set it, by setting the TargetEndpoint:
<TargetEndpoint name="xyzzy">
<Description/>
<FaultRules/>
<PreFlow name="PreFlow">
<Request>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Request>
<Response>
</Response>
</PreFlow>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<Flows/>
<HTTPTargetConnection>
<Properties/>
<URL>https://{targetBackend}/xyzzy</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo>
</HTTPTargetConnection>
</TargetEndpoint>
The documentation Apigee has on this seems very vague.
It's getting super frustrating. We have other proxies that are working fine without doing anything special.
apigee apigee-baas
add a comment |
up vote
1
down vote
favorite
I have a simple apigee proxy, but I can see in the trace an issue where the Host header going to the target contains the host of the proxy itself.
i.e. the target gets
Host: xx.apigeename.com
rather than:
Host: my.awsservername.com
The target is on a different domain to the proxy, so it means that the target server is improperly handling the request (404 in this case).
Why is it that Apigee might be sending the exact same host header and not transforming it?
I have tried to explicitly set it, by setting the TargetEndpoint:
<TargetEndpoint name="xyzzy">
<Description/>
<FaultRules/>
<PreFlow name="PreFlow">
<Request>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Request>
<Response>
</Response>
</PreFlow>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<Flows/>
<HTTPTargetConnection>
<Properties/>
<URL>https://{targetBackend}/xyzzy</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo>
</HTTPTargetConnection>
</TargetEndpoint>
The documentation Apigee has on this seems very vague.
It's getting super frustrating. We have other proxies that are working fine without doing anything special.
apigee apigee-baas
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a simple apigee proxy, but I can see in the trace an issue where the Host header going to the target contains the host of the proxy itself.
i.e. the target gets
Host: xx.apigeename.com
rather than:
Host: my.awsservername.com
The target is on a different domain to the proxy, so it means that the target server is improperly handling the request (404 in this case).
Why is it that Apigee might be sending the exact same host header and not transforming it?
I have tried to explicitly set it, by setting the TargetEndpoint:
<TargetEndpoint name="xyzzy">
<Description/>
<FaultRules/>
<PreFlow name="PreFlow">
<Request>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Request>
<Response>
</Response>
</PreFlow>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<Flows/>
<HTTPTargetConnection>
<Properties/>
<URL>https://{targetBackend}/xyzzy</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo>
</HTTPTargetConnection>
</TargetEndpoint>
The documentation Apigee has on this seems very vague.
It's getting super frustrating. We have other proxies that are working fine without doing anything special.
apigee apigee-baas
I have a simple apigee proxy, but I can see in the trace an issue where the Host header going to the target contains the host of the proxy itself.
i.e. the target gets
Host: xx.apigeename.com
rather than:
Host: my.awsservername.com
The target is on a different domain to the proxy, so it means that the target server is improperly handling the request (404 in this case).
Why is it that Apigee might be sending the exact same host header and not transforming it?
I have tried to explicitly set it, by setting the TargetEndpoint:
<TargetEndpoint name="xyzzy">
<Description/>
<FaultRules/>
<PreFlow name="PreFlow">
<Request>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Request>
<Response>
</Response>
</PreFlow>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<Flows/>
<HTTPTargetConnection>
<Properties/>
<URL>https://{targetBackend}/xyzzy</URL>
<SSLInfo>
<Enabled>true</Enabled>
<Protocols>
<Protocol>TLSv1.2</Protocol>
</Protocols>
</SSLInfo>
</HTTPTargetConnection>
</TargetEndpoint>
The documentation Apigee has on this seems very vague.
It's getting super frustrating. We have other proxies that are working fine without doing anything special.
apigee apigee-baas
apigee apigee-baas
asked Oct 29 at 11:44
Paul Deen
2891214
2891214
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
This seems odd. Apigee should not do that by default. Are you sure that other flows are setup correctly? Anyhow.. you can try to create a AssignMessage
policy that adds the correct host.
Take a look at this: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#Samples
./policies/hostPolicy.xml:
<AssignMessage name="hostPolicy" continueOnError="false">
<AssignTo createNew="false" type="request"></AssignTo>
<Set>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Set>
</AssignMessage>
./targets/xyzzy.xml
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>hostPolicy</Name>
</Step>
</Request>
</PreFlow>
NB: I haven't tested this. Read the vague apigee docs on policies
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This seems odd. Apigee should not do that by default. Are you sure that other flows are setup correctly? Anyhow.. you can try to create a AssignMessage
policy that adds the correct host.
Take a look at this: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#Samples
./policies/hostPolicy.xml:
<AssignMessage name="hostPolicy" continueOnError="false">
<AssignTo createNew="false" type="request"></AssignTo>
<Set>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Set>
</AssignMessage>
./targets/xyzzy.xml
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>hostPolicy</Name>
</Step>
</Request>
</PreFlow>
NB: I haven't tested this. Read the vague apigee docs on policies
add a comment |
up vote
0
down vote
This seems odd. Apigee should not do that by default. Are you sure that other flows are setup correctly? Anyhow.. you can try to create a AssignMessage
policy that adds the correct host.
Take a look at this: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#Samples
./policies/hostPolicy.xml:
<AssignMessage name="hostPolicy" continueOnError="false">
<AssignTo createNew="false" type="request"></AssignTo>
<Set>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Set>
</AssignMessage>
./targets/xyzzy.xml
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>hostPolicy</Name>
</Step>
</Request>
</PreFlow>
NB: I haven't tested this. Read the vague apigee docs on policies
add a comment |
up vote
0
down vote
up vote
0
down vote
This seems odd. Apigee should not do that by default. Are you sure that other flows are setup correctly? Anyhow.. you can try to create a AssignMessage
policy that adds the correct host.
Take a look at this: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#Samples
./policies/hostPolicy.xml:
<AssignMessage name="hostPolicy" continueOnError="false">
<AssignTo createNew="false" type="request"></AssignTo>
<Set>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Set>
</AssignMessage>
./targets/xyzzy.xml
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>hostPolicy</Name>
</Step>
</Request>
</PreFlow>
NB: I haven't tested this. Read the vague apigee docs on policies
This seems odd. Apigee should not do that by default. Are you sure that other flows are setup correctly? Anyhow.. you can try to create a AssignMessage
policy that adds the correct host.
Take a look at this: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#Samples
./policies/hostPolicy.xml:
<AssignMessage name="hostPolicy" continueOnError="false">
<AssignTo createNew="false" type="request"></AssignTo>
<Set>
<Headers>
<Header name="Host">{target.host}</Header>
</Headers>
</Set>
</AssignMessage>
./targets/xyzzy.xml
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>hostPolicy</Name>
</Step>
</Request>
</PreFlow>
NB: I haven't tested this. Read the vague apigee docs on policies
answered yesterday
Mr.Turtle
8632924
8632924
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53044823%2fapigee-proxy-passing-same-host-header-to-target%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown