• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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