Open flearc opened 6 months ago
ctx.var.server_port
resolves to a port on which apisix is listening (not 9080 always) isn't it? Am I missing something?
ctx.var.server_port
resolves to a port on which apisix is listening (not 9080 always) isn't it? Am I missing something?
The port is not always 9080.
I want to stress that ctx.var.server_port
is the container port apisix listening to.
But the fact is, when it's the container port, CAS will encounter a connect error because container port can not be used outside k8s.
So I suggest a new conf to solve this problem.
would you like to submit a PR for this?
Description
When deploying apisix using
apisix-docker
in a k8s environment, some users may access apisix via a domain using http/https on ports 80/443However, when enable
cas-auth
plugin, the uri_without_ticket function generates uri based onctx.var.host
, which commonly resolves to port 9080So when the CAS server redirects upon successful user login, it directs to this port, resulting in the callback failing to reach apisix as the domain is only accessed via ports 80/443.
To address this, I propose introducing a new configuration option,
callback_port
, within the cas-auth plugin. This configuration would allow users to specify the correct port for accessing apisix via the domain, thereby ensuring successful callbacks from the CAS server.