Report this

What is the reason for this report?

Requests from PhantomJS being blocked

Posted on September 29, 2021

We have an application which generates Images and PDFs from rendered HTML using PhantomJS. This is running on an nginx server.

The HTML files are saved on the same server as the application and these are requested by the headless browser inside PhantomJS.

This set up was all working perfectly for about 3 weeks when suddenly the Images and PDFs started coming back blank (black background with small blue squares where the images should be).

At first I thought the issue was related to internal DNS - the HTML file is passed to PhantomJS as a path but all the css and images are loaded in to the HTML over URLS. If I changed these URLs to point to another domain (not Digital Ocean) I could get the PDF to render. If I moved all the CSS to be inline in the HTML file it would also render (albeit without images), but no http request made by PhantomJS to the Digital Ocean server seemed to resolve.

I then tried to load one of the rendered HTML files stored on the Digital Ocean server into a PhantomJS set up hosted on a different server (again, not Digital Ocean). In this case the HTML was passed as a URL and this initial request was blocked - the PhantomJS process just hung.

It certainly seems as though Digital Ocean has started blocking all requests from PhantomJS. Perhaps these requests are being considered malicious and have triggered some security measure.

I saw this post which referred to something similar: https://www.digitalocean.com/community/questions/can-digitalocean-block-incoming-http-request

Can anyone suggest anyway to test the theory and hopefully get these requests unblocked?

Many thanks, Malcolm



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I have no specific solution here but I have had problems in the past with web page renderers when underlying package dependencies are not installed on the operating system. Is it possible your underlying operating system has been updated and the required dependencies (or versions) have been changed?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.