Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy_redirect configuration is needed in admin api #3503

Closed
kk580kk opened this issue Jun 1, 2018 · 2 comments
Closed

proxy_redirect configuration is needed in admin api #3503

kk580kk opened this issue Jun 1, 2018 · 2 comments

Comments

@kk580kk
Copy link

kk580kk commented Jun 1, 2018

We are using kong as a automatic load balance proxy. We were trying using admin API https://getkong.org/docs/0.13.x/loadbalancing/ https://getkong.org/docs/0.13.x/admin-api/ to configure kong to server web application backend (like tomcat and java application).

But now we are facing a problem , that can be fix by nginx http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect , but we can't find a same parameter to configure kong.

Is that feature needed in kong?

@kk580kk
Copy link
Author

kk580kk commented Jun 4, 2018

I'm about to try #839 to change nginx configuration

@kk580kk
Copy link
Author

kk580kk commented Jun 4, 2018

By Reading #839 ,Knowledge that I can configure nginx to fix this bug,read this to change nginx configuration:
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect
By reading https://getkong.org/docs/0.13.x/configuration/#custom-nginx-configuration knowledeg that I can chage kong-nginx.conf。
by find /|grep nignx, I find this /usr/local/kong/nginx-kong.conf confirguration file,and then I find this file was generated by /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua
Finally I change this file /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua ,at the server listening 8000 port , at the location / append this proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $2;
Restart kong, it works。
I tested the redirect 302 like this
Location: http://127.0.0.1:8000/iPlatAPM/login.jsp
before:
Location: http://10.70.xx.xx:8090/iPlatAPM/login.jsp
The probelm fixed。

@kk580kk kk580kk closed this as completed Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant