apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

http[].match.exprs - ability to refer to the internal nginx variables

Open Iced-Sun opened this issue 4 years ago • 5 comments

Issue description

I need use the $proxy_protocol_server_port variable in the match rules of ApisixRoute to do the http-to-https redirection.

We decided to terminate TLS at the load balancer, hence the annotation of k8s.apisix.apache.org/http-to-https won't work because it depends on $scheme which is always http. The proxy protocol could help with the $proxy_protocol_server_port variable but it demands the ability to be referred.

As a workaround, I created a redirection ApisixRoute and then added the vars match rules manually, for now.

Is there any plan to enable ApisixRoute to refer to arbitary nginx variables? Or better, to support even in native Ingress (e.g. as annotations)?

Regards.

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long): 1.2.0
  • your Kubernetes cluster version (output of kubectl version): 1.21.2-eks-0389ca3
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a): N/A

Iced-Sun avatar Sep 02 '21 16:09 Iced-Sun

Previously the "easy to use" was the first thing we considered when we designed this feature. So some specific settings like Query, Header and etc were introduced.

We may add another setting like NginxVar to let People extend this feature, but apparently, it's not so friendly for users. @tao12345666333 What's your idea?

tokers avatar Sep 03 '21 02:09 tokers

Previously the "easy to use" was the first thing we considered when we designed this feature. So some specific settings like Query, Header and etc were introduced.

We may add another setting like NginxVar to let People extend this feature, but apparently, it's not so friendly for users. @tao12345666333 What's your idea?

Sorry, I have too many reminders, I missed this one.

I think we should add this capability so that users can better utilize the capabilities of APISIX.

tao12345666333 avatar Sep 24 '21 00:09 tao12345666333

Previously the "easy to use" was the first thing we considered when we designed this feature. So some specific settings like Query, Header and etc were introduced. We may add another setting like NginxVar to let People extend this feature, but apparently, it's not so friendly for users. @tao12345666333 What's your idea?

Sorry, I have too many reminders, I missed this one.

I think we should add this capability so that users can better utilize the capabilities of APISIX.

If no one else, please assign to me

Belyenochi avatar Feb 14 '22 11:02 Belyenochi

👌

tao12345666333 avatar Feb 14 '22 11:02 tao12345666333

Let me try it, too.

Erhao avatar Jul 19 '22 02:07 Erhao

Hi @Iced-Sun ! Please check #1376 and #1466, I think it's done. Maybe we can close this issue. what you think?

AlinsRan avatar Dec 07 '22 02:12 AlinsRan

Nice to hear that!

Iced-Sun avatar Dec 07 '22 12:12 Iced-Sun