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

Request: api to get real server name #15

Closed
whatvn opened this issue Sep 29, 2015 · 2 comments
Closed

Request: api to get real server name #15

whatvn opened this issue Sep 29, 2015 · 2 comments

Comments

@whatvn
Copy link

whatvn commented Sep 29, 2015

Hello @agentzh ,

Thank you for this awesome module and also lua-nginx-module.
I've been trying to work with lua-upstream-nginx-module to create a redirect model inside nginx configuration, in that model, I would like to redirect user to backend address using 301 or 302 response instead of proxy-ing them.

Now I am able to redirect user, all is ok except nginx resolves backend address into ip address which is not necessary in my case.

For example I have configuration below:

upstream {
     server abc.com;
     server def.com
} 

When using upstream-nginx-module, I want to be able to get_upstream_name() will return name=abc.com instead of IP addresses of abc.com.

is it possible? Can you make that api available?

Thanks,

agentzh added a commit that referenced this issue Sep 29, 2015
…e (if any) as well, which can be the domain name if the user puts it in nginx.conf. thanks Hung Nguyen for the request in #15.
@agentzh
Copy link
Member

agentzh commented Sep 29, 2015

@whatvn Yes, it's possible. And I've implemented it in commit 57cdbce.

@agentzh agentzh closed this as completed Sep 29, 2015
@whatvn
Copy link
Author

whatvn commented Sep 30, 2015

Excellent, now everything works well.
I put this model here : https://github.com/whatvn/nginx_redirect_balancer 👍

Thank @agentzh!

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

2 participants