Hi,
I have installed the docker "syncfusion/pdfviewer-server" on the linux server. If I run the following path it works correctly (the URL name is an example):
http://wspdfviewer.mytest.com:6001/api/pdfviewer
The problem is that the web application runs over HTTPS, and Google Chrome does not allow to call HTTP resources if the web is HTTPS, so it blocks the connection and does not work.
If I try to run the URL over HTTPS it doesn't work, I get the following Chrome error: "This website cannot provide a secure connection".
I have tried to create a hosting for the domain wspdfviewer.mytest.com and install a SSL secure certificate. If I access via HTTPS to
https://wspdfviewer.mytest.com
it works correctly, but if I access via HTTPS to
https://wspdfviewer.mytest.com:6001/api/pdfviewer
it does not work.
Do you know what should I do to make it work correctly?
Thank you very much!
Hi Pere,
We have analyzed the reported issue and found that we missed to expose the 443 port in the Dockerfile. This might be the reason for the issue. We have provided the pdfviewer-server project by exposing the 443 port in Dockerfile in attachment and kindly build/run the docker image.
Meanwhile, we will build and publish pdfviewer-server docker image in our docker hub repository with our service-pack release scheduled on the 2nd week of August.
<<pdfviewer-server-project-modified-dockercompose-file>>
If you are still facing the same issue, please provide the environment (production or development) details you tried. Then, it will be helpful for us to analyze further on this issue.
Regards,
Godlin Lijo S
Hi Godlin Lijo S, thank you for the reply.
Is it possible that the docker image that you have attached is not well created? it has a size of 1 MB and instead the one I have downloaded from the Docker HUB has a size of 352 MB.
Once the image is uploaded to Plex Docker (I had to compress it to .tar) the configuration options come out different from the official image in the Docker HUB (images attached).
Am I doing something wrong?
Thank you very much!
Attachment: Images_512d2619.zip
Ok, I understand that I have to create the docker image from the attached files.
I'll try it and let you know if it worked for me.
Thank you very much.
I have created the image and configured it so that port 80 redirects to port 6001, and port 443 redirects to port 6002.
With port 6001 it works correctly, but if I access the url:
https://wspdfviewer.mytest.com:6002/api/pdfviewer
It does not work and the following error is displayed:
Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.
Am I doing something wrong?
Thank you very much!
Hi Pere,
Thank you for your update.
We can configure the HTTPS port mapping in different method and it depends on the application hosted environment. Kindly refer and try the below documentation to configure HTTPS support to an application.
If you are still facing the same issue, we need more details about the DNS/SSL configuration from your side, Then, it will be helpful for us to create your environment and analyze further on this issue.
Please provide the following details,
Regards,
Parthipan
Hi Parthipan,
I provide you with the information:
If you want to test directly with the control panel of my test server, you can ask me privately for the information.
If you need more information do not hesitate to ask me.
Thank you very much!
Hi,
With the instructions in the first link (Hosting ASP.NET Core images with Docker over HTTPS) I managed to make it work over https (in red, not secure).
Now I have to try using the url in the code and see if with Chrome it works correctly.
Thank you very much!
Hi Pere,
Thanks for your update.
We are glad to hear that you run the docker container over HTTPS with the help of shared documentation. Please let us know if any other concerns about it.
Regards,
Parthipan
Hi,
I have been able to test it and it works correctly!
I only have a couple of doubts:
1. The URL in Chrome comes out as https (in red, not secure). Chrome does not show any error in the debug console. I understand that there is no problem that it marks it as https in red (not secure) instead of https in green (secure) for the correct functioning of the web service?
2. The DocumentEditor add-on also uses a docker image, can you do the same update to make it work over HTTPS?
Thank you very much!
Hi pere,
Sorry for the inconvenience, we are facing some difficulty in validating the issue and We will analyze further on this and update you with more details on July 27, 2022.Thanks for your patience.
Regards,
Arun Kumar
Hi Arun Kumar,
I managed to get the https URL working with a valid certificate (green color in Chrome).
The only question is if you can make the same update so that the Docker image of the DocumentEditor also works over https.
Thank you very much!
Hi Pere,
Please get the document editor docker project from below linkand it also works over https.
Regards,
Suriya M.
Thank you very much Suriya!
Hi Pere,
Thank you for your response
Regards,
Arun Kumar
What did you finally do to get it all to work over https?
My command is
docker run --name syncfusion -d -p 6001:80 -p 6002:443 --restart=unless-stopped -e SYNCFUSION_LICENSE_KEY="N.....c=" syncfusion/pdfviewer-server:latest
I can reach it via http by IP and name, but I cannot reach it using https (red/green/whatever).
Configuring the docker as shown in the image attached and using your own certificate.
To enable HTTPS in your local environment, please follow these steps:
|
|
|
|
By following these steps, you will be able to run the PDF Viewer docker image with both HTTP and HTTPS ports. The HTTP port will be accessible at http://localhost:8000/api/pdfviewer, and the HTTPS port will be accessible at https://localhost:8001/api/pdfviewer.
Screenshot: