Ambassador Mapping Rewrite Needs Original URL In Header - http-headers

I'm using Ambassador Mappings created through a Helm chart in order to rewrite and forward a web request. The client has requested that we include the originally requested URL in a header when we forward the request.
Based on documentation, it looks like there are only two dynamic values I can set: %DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT% and %PROTOCOL%, neither of which seems to solve my issue.
Are there any ways for me to set this header properly through an Ambassador mapping?
Thanks!

So I think we've found the solution. If you use Envoy's syntax and make sure that is forwarded through, you can use their REQ() function, to get the authority and path, to construct the URL. For example:
http://%REQ(:authority)%%REQ(:path)%
Here is the documentation for all of the possibilities you can use with Envoy through Ambassador's mapping: https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#custom-request-response-headers

Related

Redirect and change the request method and content

I was reading the mod_rewrite documentation but haven't found an example to match the following scenario.
The use will try to use a GET request to /api/getCars.
On apache I need to change this request to POST method, to a different server, like https://internal_server/getAllCars, and I need to add some content on the body of this request and send it as x-www-form-urlencoded Content Type.
Which apache module do I have to use to achieve this behavior.
Can anybody provide any example?
Thanks

Is there any way to get the original Host header value?

This article says:
With these added headers, Cloudflare passes on all HTTP headers as is
from the client to the origin.
However, there doesn't appear to be a standard way to get the Host from the original request.
Is there a way to do this, either via standard options or enterprise option?

Rewriting the response header in traefik

I have a kubernetes cluster and I am using traefik ingress controller to route traffic to deployments inside the kubenetes cluster.
I am able to use ingress.kubernetes.io/rewrite-target annotation to change the incoming request path to the one expected by the backend.
For example : /star is transformed to /trek by the rewrite target annotation and the request gets routed to /trek and backend processing is successful.
What I want to know is if there is a way to change response header so that /trek gets changed back to /star?
Did you get an answer to this? It looks like similar functionality is available in Apache Traffic Server: https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html, but would be good to have it in traefik
The functionality that does this is modifiers and specifically ReplacePath. Here is a similar answer with some examples.

Typolink across domain using SSL behind proxy

There are two page trees in my TYPO3 and I link between them. Both websites use an SSL/TLS encryption for the frontend delivery and thus should only generate relative links (if on the same domain) or link to my second domain (which it does, but only using http and not https).
Now the reason for this seems clear: I've never told TYPO3 to only generate https links. The question is: how would I do that in the first place?
I've come accross the possibility to work with config.absRelPrefix but this doesn't work when linking across domains.
use
config.typolinkCheckRootline = 1
this way typolinks check if the target page belongs to the current domain.
https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#typolinkcheckrootline
Apparently, config.typolinkCheckRootline = 1 as well as any combination of config.absRelPrefix and config.baseUrl won't help it, if TYPO3 get's the wrong HTTP host and only get's the host via HTTP_X_FORWARDED_HOST env var.

Can I use a custom domain name for API in Parse.com?

I’ve read the Parse documentation regarding custom domain names, and I understand that I can host web content at a custom domain name.
Is it also possible to use the Parse REST API, or Cloud Functions, via a custom domain name?
Example:
https://api.myshoewarehouse.com/v1/shoes/
instead of…
https://api.parse.com/1/shoes/
Looks like it is not allowed by parse.com directly. The only way to do it is to configure proxy server somewhere on your machine, like here.
Another way is to set api.myshoewarehouse.com domain record to CNAME pointing at api.parse.com. But then you need to:
ignore certificate check, e.g. with curl -k option, which obviously isn't safe thing
forget about changing URL path (e.g. /1/shoes/ can't be changed to /v1/shoes/)