Rendering NextJS response in Rails

I am trying to figure out how I can render the response from a NextJS request inside a rails application as as attempt to iteratively modernize my application (Trying to avoid putting react into the rails app as I am looking to break the code out into separate services as well at the end). Currently I have it where I am seeing this in the browser (I can see the title on the tab change so I know it is rendering the html from the response)

enter image description here

Can ensure the html document is being rendered like so

enter image description here

The problem is my rails application doesn’t serve any of the javascript that is being returned from the NextJS application. If I inspect one of the 404’s I can see that it’s looking under /_next/static for all the responses, which doesn’t exist as far as the rails application knows.

enter image description here

I have looked for documentation around this for both rails and NextJS and have not found anything. Anybody know how I can serve the javascript assets along with the html or have any other suggestions?

This is the method on my registration controller in Rails and how I am rendering the html from the NextJS response.

  def new
    @html = HTTParty.get("http://localhost:3000")

    render html: @html.html_safe
  end