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

Response url from conversion service having private ip #164

Closed
ghartaan opened this Issue Sep 6, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@ghartaan

ghartaan commented Sep 6, 2017

I am running document server in a docker container on a linux host machine. I am using conversion service of document server to generate thumbnails for my files. I send a post request to document server and gets back the response in xml. The response is in the following form:

http://172.17.0.2/cache/files/conv_pdf_1280_720_pdf/output.pdf/output.pdf?md5=cEUYq6BxASIG6b3qzxhh0A==&expires=1507288279&disposition=attachment&ooname=output.pdf 100 True

The generated file url
[url]http://172.17.0.2/cache/files/conv_pdf_1280_720_pdf/output.pdf[/url]
has the private ip [172.17.0.2] of container so not accessible from outside world.
Is there any way to configure document server so that a client on a remote machine can make a request and can access the generated output file using the response url?

Thanks in advance.

@agolybev

This comment has been minimized.

Show comment
Hide comment
@agolybev

agolybev Sep 6, 2017

Contributor

Hi @ghartaan,
Document server uses a host name from a http request to generate output url in a http response.
So, the local ip or the local host name uses when you make request inside local network.
There is the same result if you use proxy server before document server. See this guide to get the document server work on correctly.

Contributor

agolybev commented Sep 6, 2017

Hi @ghartaan,
Document server uses a host name from a http request to generate output url in a http response.
So, the local ip or the local host name uses when you make request inside local network.
There is the same result if you use proxy server before document server. See this guide to get the document server work on correctly.

@ghartaan

This comment has been minimized.

Show comment
Hide comment
@ghartaan

ghartaan Sep 7, 2017

The problem is response from document server conversion service returns the url of generated file. And that generated file is stored on document server host machine which is a container in our case.
Is there any way to store this generated file at some remote location?

ghartaan commented Sep 7, 2017

The problem is response from document server conversion service returns the url of generated file. And that generated file is stored on document server host machine which is a container in our case.
Is there any way to store this generated file at some remote location?

@agolybev

This comment has been minimized.

Show comment
Hide comment
@agolybev

agolybev Sep 7, 2017

Contributor

Hi @ghartaan
Your service should download converted file and store it in own storage, then generate link to it.

Contributor

agolybev commented Sep 7, 2017

Hi @ghartaan
Your service should download converted file and store it in own storage, then generate link to it.

@agolybev

This comment has been minimized.

Show comment
Hide comment
@agolybev

agolybev Sep 7, 2017

Contributor

Try changing Host header in request to document server. Also you can add X-Forwarded-Proto and X-Forwarded-Host HTTP headers. X-Forwarded-Proto header is a de-facto standard header for identifying the protocol (HTTP or HTTPS) that a client used to connect to the proxy or load balancer. X-Forwarded-Host is a standard header for identifying the original host requested by the client in the 'Host' HTTP request header.
So, the documentserver will use those value to assemble output url.

Contributor

agolybev commented Sep 7, 2017

Try changing Host header in request to document server. Also you can add X-Forwarded-Proto and X-Forwarded-Host HTTP headers. X-Forwarded-Proto header is a de-facto standard header for identifying the protocol (HTTP or HTTPS) that a client used to connect to the proxy or load balancer. X-Forwarded-Host is a standard header for identifying the original host requested by the client in the 'Host' HTTP request header.
So, the documentserver will use those value to assemble output url.

@ghartaan

This comment has been minimized.

Show comment
Hide comment
@ghartaan

ghartaan commented Sep 7, 2017

Thanks @agolybev .

@agolybev agolybev closed this Sep 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment