What steps do I need to take in order to implement a Next.js project using the http protocol in a production

Currently, I am in the process of creating an intranet webpage that will be hosted on a private network using Next.js.

However, when the production-level Next.js web app is built and running, it forces the loading of files (CSS, JS, images) via the HTTPS protocol.

Unfortunately, I need to use HTTP protocol for my project since it will only run on a private network.

Is there a way to configure a Next.js project to use HTTP protocol while being deployed on a production server?

Answer №1

I managed to find the solution. The issue was related to the content security policy (CSP). I disabled the CSP in the private network settings.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

the next development and build process becomes frozen indefinitely

Each time I try to execute pnpm dev, it seems to hang at ready - started server on 0.0.0.0:3000, url: http://localhost:3000 without displaying any errors. However, the server does not actually start at localhost:3000 because the page doesn't load when ...

NextJs/Express Server Encounters Domain HTTPS Request Error

Yesterday, I successfully deployed my website on a VPS. Everything was working fine on the VPS IP until I installed certbot on my domain. Unfortunately, I encountered the following error: Mixed Content: The page at 'https://mydomain.com/' was loa ...

Why is my custom 404 page failing to load after building my Next.js application?

I recently set up a custom 404 page for my Next.js app and wanted to test it locally before deploying to the server. To do this, I used the "serve" package to host the project on my local machine. However, when I tried navigating to a non-existent page, th ...

Is there a way to serve server-side rendered content exclusively to search engine crawlers like Google Bot, without SSR for regular users in Next.js?

With a staggering number of users visiting the site every day, we are making strides to enhance our visibility on Google by implementing SSR (which may sound unbelievable) and achieving a richer preview when content is shared on messaging platforms. As th ...

``The powerful combination of NextAuth and OneLogin integrated into a NodeJS and Express API

This pertains to a previous inquiry I made concerning my project. The scenario is as follows: I have developed a NextJS application that utilizes NextAuth with OneLogin for authentication and stores session data in Mongo Atlas. The app is hosted on Vercel. ...

Having trouble resolving '@auth0/nextjs-auth0' during deployment on Vercel? Check out this error message: "Can't resolve '@auth0/nextjs-auth0' in '/vercel/path0/pages'"

I recently deployed a project on Vercel and have been working on enhancing the layout to achieve a minimum viable product (MVP). As part of this process, I decided to switch my authentication method to @auth0/nextjs-auth0 package for Next.js. After running ...

The incorrect order of CSS in NextJS production build

When working on my project, I make sure to import CSS files both from local sources and node modules: //> Global Styling // Local import "../styles/globals.scss"; // Icons import "@fortawesome/fontawesome-free/css/all.min.css"; // Bootstrap import "boot ...

Steps for transferring data from a POST response to the client in NodeJS/ExpressJS

I am currently in the process of setting up an EasyPost API and I need to save some data that is included in a response from a POST route. My goal is to send this data directly to the client for storage, but I am struggling to determine where or how to do ...

Encountering a code ELIFECYCLE error when running npm run dev

In my current project, I am utilizing the nextjs framework along with various npm package modules. Initially, everything was working smoothly during development. However, upon restarting the application using the command npm run dev, I encountered an error ...

What could be causing my Next.js layout to re-render?

I currently have a basic root layout set up in Nextjs (app router) that displays a navigation bar and the child components underneath it. ROOT LAYOUT import "./globals.css"; import type { Metadata } from "next"; import { Inter } from & ...

Server-side authentication with NextJS fetching

I am currently exploring the functionalities of NextJs with App Routing and how it integrates with authentication. Most examples I have come across, including the documentation, primarily use the older routing mode. Creating an API route for clients and i ...

The designated redirection path, as indicated in the 'next.config.js' file for a particular project, has now been applied to all projects

Something strange is happening... I set a redirect path for the root index page in one of my projects and it worked perfectly, but now all of my other projects are also being redirected to that same path when I try to visit localhost:3000. It's alway ...

Troubleshooting: Nginx reverse proxy issue with Next.js API route

I am faced with an issue in my nextjs app running behind nginx using reverse proxy. I am encountering a 504 error (Gateway Time-out) when trying to process POST requests to /api/ It functions flawlessly when tested on a virtual machine within a local net ...

Register when a user signs up or buys a product from stripe's subscription service

Currently, I am in the process of developing an application that allows public users to access a pricing page and choose a plan (utilizing stripe for subscription payments). Once a user selects a plan and proceeds to checkout, my aim is to have them redi ...

Is it necessary to check the IP address along with the signature for Stripe webhook security?

My Next.js app utilizes webhooks to manage incoming customer payment events from Stripe. Following the provided example, my webhook first verifies the signature of the incoming event: const webhookSecret = process.env.SECRET_STRIPE_WEBHOOK const webhookHa ...

Tips for transferring an image file through formdata to a React/Next.js api

I am attempting to upload an image file to a cloudinary API within a Next.js application: The function calling the API is as follows: async uploadButtonClicked(imageUpload) { const formData = new FormData(); //formData.append('test', ...

Creating a flexible route path with additional query parameters

I am facing a challenge in creating a unique URL, similar to this format: http://localhost:3000/boarding-school/delhi-ncr However, when using router.push(), the dynamic URL is being duplicated like so: http://localhost:3000/boarding-school/boarding-school ...

Error Encountered: Unhandled Runtime Error in Next.js with Firebase - TypeError: Unable to access the property 'initializeApp' as it is undefined

It's baffling why this error keeps appearing... my suspicion is directed towards this particular file. Specifically, firebaseAuth={getAuth(app)} might be the culprit. Preceding that, const app = initializeApp(firebaseConfig); is declared in "../f ...

A guide to troubleshooting and resolving the elusive 500 Server Error in Next JS API

Currently, I am in the process of developing a chat bot using the innovative OPEN AI GPT 4 Model within NextJS. However, upon sending a POST request to http://localhost:3001/api/generate, I am faced with a Response displaying a status code of 500 along wit ...

Attribute specified does not belong to type 'DetailedHTMLProps<ButtonHTMLAttributes

I am working on creating a reusable 'button' component and I would like to include a href attribute so that when the button is clicked, it navigates to another page. An Issue Occurred: The following error was encountered: 'The type '{ ...