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

about the automatically generated ("rel":"self") links #107

Open
fjasonlin opened this issue Sep 17, 2019 · 4 comments
Open

about the automatically generated ("rel":"self") links #107

fjasonlin opened this issue Sep 17, 2019 · 4 comments

Comments

@fjasonlin
Copy link

Hello, my name's Jason and I have a question about the automatically generated ("rel":"self") links.
I'm running a RedDog RDAP server in a docker container, in which the server IP would be detected as a private IP like 172.17.0.2.
While checking RDAP query result, I found links automatically generated by the server adopt the private IP (and the default port 8080) in the URLs (like the one below)...
I wonder if a domain can be assigned (to replace 172.17.0.2:8080) instead.
Thank you so much in advance!

... "links":[{"value":"https://172.17.0.2:8080/rdap/domain/test.tld.","rel":"self","href":"https://172.17.0.2:8080/rdap/domain/test.tld.","type":"application/rdap+json"}] ...

@dhfelix
Copy link
Contributor

dhfelix commented Sep 17, 2019

Hi,

The protocol and domain part in the self-generated links are obtained through what the user has requested.

For example:

    user web browser request: http://localhost:8080/rdap/domain/test.tld
    Self link response: http://localhost:8080/rdap/domain/test.tld.

    user web browser request: https://rdap.registrar.tld/rdap/domain/test.tld
    Self link response: https://rdap.registrar.tld/rdap/domain/test.tld.

Here you can see the code part of how we get the protocol and the domain.

In our internal tests, we have mapped in the DNS of the local machine, a domain to the IP where the RDAP server is located, and then we consult that domain and see that the self-links have the requested URL.

Also, We have done tests for what we think how is implemented in production, that is, install an Apache with Reverse Proxy in front of the RDAP-server, and configure the DNS to point to the ReverseProxy, and we have obtained the self-links with the domain name instead of the IP address.

@fjasonlin
Copy link
Author

Sorry for my late response!
I just finished deployment and tried access the service through the actual URL (including domain).
Yet private IP is still included in the return as the printscreen shown below~

May I have some more advice?
Thank you so much!

image

@dhfelix
Copy link
Contributor

dhfelix commented Oct 3, 2019

Did you enable proxyPreserveHost in your reverseProxy?

In the next link I wrote a basic example for apache and nginx about how to do this.
#105 (comment)

but basically if you are using apache:
ProxyPreserveHost On

for nginx:
proxy_set_header Host $http_host;

@fjasonlin
Copy link
Author

fjasonlin commented Jul 10, 2020

@dhfelix
Thank you sir, it works perfectly!!!

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