• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Issue Node.js - Domain names not resolved correctly when performing local GET requests during build-time

tacriela

New Pleskian
Server operating system version
Debian 9.13.0
Plesk version and microupdate number
18.0.44
Hey everyone,

So I ran into this "interesting" scenario today. First, allow me to explain what it is that I'm trying to accomplish:

I would like to run a Next.JS application in combination with a Strapi backend CMS on my Plesk server. In order to get the best out of Next.JS I need to perform an API request during build-time, such that it can statically render the pages specified in the CMS. I had previously set it up without this static rendering, which worked perfectly fine, however I have changed this to fetch the data build-time since today. Locally, my Next.JS project works completely fine (even when connecting it to the remote CMS), however, as soon as I try to build the Next.JS app on Plesk, it for some reason redirects all of my "local" GET requests to my server's router (so any GET request to a URL that is hosted on my Plesk, even if it is a different website. Whenever it is not local, such as google.com, it loads the page perfectly fine), and I end up with a PfSense error stating that I'm performing a potential DNS rebind attack. When I disable this rule, I just end up on the login page of my router, so my router blocking certain requests does not seem to be the issue.

Does anyone perhaps know what is happening here? I have also tried different GET methods, such as http and Axios, but unfortunately they all have the same result. My log can be found below:

EDIT
This not only happens during build-time, but also when I'm using Next.js' getServerSideProps, which uses server-side rendering to fetch the data. Basically what's going wrong is any data I'm trying to fetch from a local domain on the server side ends up on my router's page.
 
Back
Top