mhofer117 commented on issue #4942:
URL: https://github.com/apache/apisix/issues/4942#issuecomment-4609253417
For anyone else running into this issue again with proposed rewrite rules
not working:
It appears the behaviour has slightly changed with #12551
X-Forwarded-* headers are now set _after_ plugins run (in
`set_upstream_x_forwarded_headers`) and use slightly differen variables.
This is what worked in our k8s cluster with ingress-apisix 2.13.0:
```
apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
name: forwarded-port-correction
spec:
ingressClassName: apisix
plugins:
- name: serverless-pre-function
enable: true
config:
phase: "rewrite"
functions:
- "return function(conf, ctx) if ctx.var.http_x_forwarded_port ==
\"9443\" then ctx.var.http_x_forwarded_port = \"443\" end end"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]