Questions tagged [nginx]

Nginx, known as a versatile web and proxy server, serves numerous functions in the digital realm. However, it is important to note that queries related to server software utilization and customization might not be directly tied to programming and could be deemed irrelevant for this platform. In such cases, exploring alternative outlets like Newtab Q&A, Newtab Q&A, or Webmasters on Newtab Q&A would prove to be more fitting venues for seeking expert advice.

What is the best way to bust the cache for my Vue applications that are deployed on Ngin

Greetings! I am facing an issue with my Vue apps deployed on an nginx server. Sometimes, updates do not reflect for users due to cached versions. Is there a way to clear the cache without renaming all files and components in the apps? Are there any user-f ...

Strategies for troubleshooting a blank page issue when launching a secondary Vue application with nginx

I am looking to run multiple Vue.js v3 apps with nginx on macOS Big Sur. The first app is located at: /Users/kharraz/Developer/code/homeapp/dist; And the second app is located at: /Users/kharraz/Developer/code/businessapp/dist; Both folders contain outpu ...

Using Traefik for HTTPS redirection with Docker Compose, the Vue+Nginx application is encountering a 404

Hello everyone, I am a newbie developer and excited to share that I am deploying my first full stack project. I'm currently working on running a vuejs+nginx client app in a docker-compose setup which includes mysql, a nodejs backend, and traefik for handl ...

Frequent 502 bad gateway issue arising intermittently on server configuration with nginx, nodejs, and mongodb stack

We are currently using nodejs(v 0.10.29), express, nginx(version 1.4.6) with mongodb(v 2.6.3) replicaset and encountering sporadic 502 bad gateway errors. Although pm2 logs fail to capture the error, nginx's error.log is indicating: recv() failed (104: Co ...

Is it better to use relative or absolute resource scripts in an AngularJS application?

My project involves building a single-page JavaScript app using AngularJS. In order to achieve this, the index.html file has a specific structure: <html> <head> <base href="/" /> ... </head> <body id="ng-app" ng-app="myAngularAp ...

Encountering errors with CORS middleware when attempting to make a POST request to

I've developed a CORS middleware to prevent "CORS error" for all APIs. Here's my middleware code: $response = $next($request); $response->headers->set('Access-Control-Allow-Origin', '*'); $response->headers->set('Access-Control-Allow-Methods', ...

What steps can be taken to create a React app for production that won't cause the website to go

Can a react app be successfully built for production using the command npm run build without causing the website to go offline? I have set up nginx to host my react app, but when I execute the mentioned command, I encounter an "Internal server" error unt ...

What is the best way to host a single page application within a sub-directory using nginx?

Trying to set up nginx to host an Angular application from a unique child path. Adjusted the app to use a base href of fish, able to serve root page and assets correctly. However, encountering a 404 error when attempting to reload the page on a child rout ...

Using a single database for managing authentication across various websites

I'm new to setting up websites this way and could really use some advice on my unique situation. Here's the setup: I have two separate websites, WS1 & WS2, each with their own domain names. Both sites point to the same IP address using ngi ...

Guide on setting up staticfile_buildpack header configuration for an Angular application

After creating a build with ng build --prod, the dist/AppName folder was generated. Inside this folder, I found my manifest.yml and Staticfile. When I tried to do a cf push within the dist/AppName directory, everything worked as expected. However, I want ...

I am utilizing Docker and NGINX to deploy my NextJS application, allowing me to incorporate a unique base path

After successfully creating an application that works flawlessly locally, I am now faced with the challenge of deploying it on a server with a custom base path. My app is being deployed to a Docker Container where I have another Docker Container running NG ...

implementing node.js and express with nginx using multiple locations

I am working on hosting two separate node apps using express under a single subdomain, while having nginx handle the serving of static files. In both of my node apps, I am utilizing the following code: app.use(express.static(path.join(__dirname))); Below ...

The Docker Angular container is experiencing difficulty connecting to the Express server container, despite the fact that they are both on the same network

In my current setup, I have an Angular application running on a Nginx server within a Docker container. The base image for this container is nginx:stable-alpine and its name is "admin-users-cont". This container is part of a Docker network named "tutorial- ...

Utilizing two nearby node servers to route traffic according to designated paths

I am seeking a solution to achieve the following: There are two servers running locally on different ports: localhost:3001 localhost:3002 I want a third server on port 3000 to route all traffic to localhost:3001 except for specific paths that are white ...

Are HTML files and PHP generated files cached differently by web browsers?

My current setup involves Nginx as a web server and Firefox to check response headers. I added two files on the server - test.html and test.php, both containing the same content. In the Nginx config file, I have set the expires directive to 30d in the serv ...

Issues with Nginx serving .min.css and .min.js files

I am struggling with my Ubuntu VPS that has nginx installed on it. The issue I'm facing is related to .min.css and .min.js files, as nginx seems to be rendering empty HTML files instead of serving them correctly. Can anyone help me identify and solve ...

Error encountered when attempting to listen on port 443: EADDRINUSE

My React application requires an HTTPS connection, so I have to run it on port 443. Regardless of the port I use, I keep encountering the following error: 0|server | at Module.load (node:internal/modules/cjs/loader:981:32) 0|server | at Functi ...

Uploading files with jQuery AJAX across different domains

What I'm facing is an issue with uploading files to a subdomain that serves as an API endpoint for file uploads. Every time I try to upload a file using jQuery from the main www domain to this subdomain, I encounter an error. XMLHttpRequest cannot ...

Having trouble getting a React app integrated with WordPress on an NGINX server to function properly over HTTPS?

I am currently in the process of developing a React application that integrates with a WordPress site. The setup I am aiming for is as follows: When users visit example.com, they will be directed to my React app. If they navigate to example.com/blog, they ...

What are the steps for creating an nginx http cache file from scratch?

Is there a way to create nginx http cache files using PHP? The file structure should look like this: {bytecode} KEY: {cache_key} {bytecode}{http_headers} {body} I'm wondering how we can generate the {bytecode} placeholders? ...

Why does socket.io have trouble connecting when clients are using different IP addresses on separate wifi networks?

I've encountered an issue where socket.io won't connect when clients are on different wifi networks (ip address) using my self-configured Ubuntu Nginx server. Strangely enough, it works perfectly fine on a pre-configured Heroku server. Here is a ...

What is the reason for needing to execute the "FLUSH HOSTS;" command daily in my project?

My project using a LEMP stack is currently hosted on Digital Ocean and I'm encountering an error: Host '167.71.227.200' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' Every day, I have to use FLUSH HOSTS; command to re ...

Insert the link to the error log (WordPress, Nginx, PHP7)

It is my goal to include the URL for each error recorded by PHP and Nginx. The error log specifies the script in question, which is used for various URLs with distinct data sources (remote APIs). I suspect that this error is related to specific data from ...

Dockerized Nginx: Struggling with location configuration issues

Here is the docker file: FROM nginx:1.17.4-alpine # copy artifact build from the 'build environment' COPY ./dist /usr/share/nginx/html/ COPY ./default.conf /etc/nginx/conf.d/ # expose port 80 EXPOSE 80 # run nginx CMD ["nginx", "-g", "daemon off;"] The ...

Setting up NGINX (Engintron) for Node.js on a particular port to switch from HTTPS to HTTP

I am completely new to web server configurations and have been struggling to find a working setup for weeks. Any advice or comments would be greatly appreciated! I currently have a CentOS machine with cPanel (EasyApache running on ports 8080 and 8443) and ...

navigating to the assets directory using nginx and vite

My setup involves using nginx and vite to docker vue.js, but I'm facing an issue when setting the base path where the browser screen goes blank. The /test/index HTML page loads fine, but the /test/assets/something.js and CSS files return as HTML. How can I ...

I am interested in incorporating `connect-history-api-fallback` into my project in Vue.js, but I am unsure about the implementation

After refreshing the page in Vue.js, I encounter an Nginx error. I am currently using 'connect-history-api-fallback', but I'm uncertain about how to implement it in Vue.js. I noticed its usage in app.js with middleware server; how can we use ...

Having trouble connecting to a recently installed PostgreSQL database through a php script

Having recently transitioned from MySQL to PostgreSQL, I installed PostgreSQL on my Fedora system and set up the postgres user following the instructions on the Fedora wiki. After creating the role using the psql shell while su-ing into the postgres user, ...

Expose the app's homepage through the nginx server configuration

I currently have a server running Nginx and hosting an Angular 4 application under the domain www.mysite.com. However, I now have another domain called www.mySecondDomain.com and I want this site to open a specific route within the same angular app. For ex ...

Using AngularJS `$state.go` to navigate without redirection in ExpressJS

I'm facing a strange issue with my ExpressJS setup for serving AngularApp Files locally. I have a main controller with the following code snippet: else{ console.log('Forwarding to Login'); $state.go('signin', {}); conso ...

Encountering a 502 Bad Gateway when attempting to deploy an Express Generator Template on Elastic Bean

After generating a simple express app using the express generator, I tested it on localhost:3000 during development and everything worked smoothly. However, when I deployed the app to elastic beanstalk using the eb command-- git aws.push, I encountered a ...

Nginx reverse proxy throws a 'Cannot GET' error when connecting to socket.io on an express.js server

Recently, I followed a tutorial on setting up Node.js with Nginx on two Ubuntu 14.04 servers connected via private networking. The setup involves having Node.js running on myappserver (accessible via private IP myprivatewebserver and publicly via mypublica ...

Wordpress: nginx encountered an error

I set up my wordpress website on DigitalOcean, following a tutorial from this site. The next day, my wordpress site went down and I encountered the following error message: "An unexpected error has occurred. Apologies, but the page you are trying to acc ...

Dealing with the HTTP 413 Request Entity Too Large error within a Node JS Project on Google App Engine

My backend app is currently deployed on GAE. One of the features it offers is an API that allows users to upload files to a GCS bucket. I recently encountered an issue when trying to upload a file larger than 50mb, receiving an error message stating 413 Re ...

NextJS fails to load on iPhones connected to cellular data

I recently completed the development of a NextJS web application using React on my MacBook Air M1. After compiling a Docker image to ensure compatibility with amd64 processors, I deployed it to an AWS EC2 instance running Ubuntu 20.04 on an x86_64 processo ...

What is the best way to handle extensionless files and serve them as text/html using Express?

Currently, I am facing an issue with serving extensionless files as text/html on my static website using Express and Nginx. Despite my attempts to modify the MIME type in a managed environment like Azure App Service on Linux, the files are still being serv ...

The Speed of Apache Requests

After setting up my server with centos6, I decided to use a combination of nginx as the frontend and apache as the backend, along with APC for optimization purposes. To benchmark the performance, I used the following command: ab -n 1000 -c 100 http://doma ...

"Challenges encountered when integrating Vue.js with Ngin

Hello, I'm currently running a setup with node, express, and vue. Below is my nginx configuration: server { listen 443; server_name mydomain.me; ssl on; ssl_certificate /root/mydomain.me.cert; ssl_certificate_key /ro ...

Troubleshooting Next.js deployment with Nginx: experiencing a 403 forbidden error with chunk script files

After deploying my Next app using Nginx, I encountered an issue where the js files inside the _next/static/chunks directory were getting a 403 forbidden error. https://i.stack.imgur.com/TB9TX.png Interestingly, only the js files in the chunks directory w ...

I'm having trouble getting nginx to serve my react index.html as a fallback. Can anyone help troub

I am encountering an issue with my setup involving two docker images on the same machine. One image is running nginx serving a react app, while the other is a back-end express server. The problem arises when my front-end app uses react router to create rou ...

Can Next.js be integrated with Docker and Nginx for a seamless development environment?

I have a nextjs project that I want to run using Docker and nginx. The setup requires nginx to connect to nextjs behind the scenes, with only nginx being able to communicate with nextjs (users must talk to nginx to access nextjs). Given the typical nextjs ...

The React application running on nginx becomes unresponsive when accessed on mobile devices

I am currently attempting to host a React website built with create-react-app and using Material UI on a Raspberry Pi 4 with Nginx. When I run the site locally using npm start and go to localhost:3000, everything looks fine. However, when I deploy the prod ...

Error message encountered in MEAN application request

Learning how to use the MEAN stack has been an exciting journey for me as I venture into building web apps. Rather than relying on yeoman generators or npm app to do the heavy lifting of generating code, I have delved into creating my entire app from scrat ...

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 ...

Optimal storage locations for static files in Django applications and configuring Nginx to serve static files from multiple directories

I'm working on a Django application where static files are being served through nginx. I am looking to add a new feature to the project. My initial thought is to create a new app and place the necessary files under the static folder. However, this would r ...

Deploying an Angular application on AWS EC2 without using nginx as a reverse proxy

Our team has been tackling the challenge of hosting an Angular application on AWS. A question has emerged: can we deploy the Angular application without relying on nginx? This inquiry arose when we successfully deployed a node.js application without any ...

"Utilize the Nginx proxy_pass_header for seamless header

I'm attempting to use the command proxy_pass_header Connection; for my node.js server, but I've encountered an issue where my response header keeps getting overwritten with Connection : keep-alive, even after explicitly setting it to Connection : close. C ...

I am interested in downloading and setting up the mechanic package from npm. However, I encountered an error while attempting to execute the following command: "sudo npm install -g mechanic". Unfortunately, I am having difficulty

I am experiencing an issue while trying to install a mechanic on my nginx server. When I execute the command sudo npm install -g mechanic, I encounter the following error: tigaron@galaxybrainpower:/var/www/tigaron$ sudo npm install -g mechanic /usr/bin/m ...

Server lacks Nginx rewriting capabilities

I need to adjust the nginx configuration so that index.php in the public_html folder handles all requests except for files and folders. Although I know how to do this in htaccess, like the following: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_F ...

Encountering the ERR_TLS_CERT_ALTNAME_INVALID error in Next.js while using pm2

What is the solution for this error in Next.js? The project was deployed using PM2 and Nginx. Error [ERR_TLS_CERT_ALTNAME_INVALID]: The hostname/IP does not match the certificate's altnames. Host: scimagine.com. is not included in the cert's altnames: DNS ...

What could be the reason for the onmessage listener not handling the initial SSE event?

When a client connects to a Node Express server, it creates a new EventSource. The server sends an SSE event upon initial connection and then at a 30-second interval thereafter. Strangely, the client's onmessage handler does not respond to the initial ...

tips for optimizing javascript file caching

https://i.stack.imgur.com/UhWD1.pngMy web application was created using "pug" technology about 9-8 years ago, and more recently, pages have been added in an innovative framework (vue.js). However, whenever there is a transition between an old pug page and ...

Unrecognized directive in Nginx and node.js configuration

I'm facing an issue while trying to create a configuration file for nginx. The error message I received is: unknown directive "proxy_http_version" in /etc/nginx/conf.d/mydomain.conf:24 Configuration File Path: /etc/nginx/conf.d/mydomain.conf Ngin ...

The second nginx website is not functioning properly

I am facing a strange issue where the first reverse-proxy site is working perfectly fine, but when I try to add a second site-enabled with almost identical settings except for a few major changes like the server_name, nginx simply refuses to start or reloa ...

Delivering Django and Vue applications efficiently through an Nginx server

I have a website that utilizes Django for the API and Vue for the frontend. When deploying the site, my current process involves: Generating a production build of the Vue app (npm run build) Transferring the Vue dist folder to a specific directory within ...

Cookie version 68 and below is no longer supported in Chrome

Currently, I am conducting tests on a React application that utilizes an Nginx and Express backend with cookie-based authentication. While testing on older browsers through services like BrowserStack and LambdaTest, I encountered a peculiar issue with cook ...

What is the best method for eliminating port number 8080 from my domain name with nginx version 1.14.1?

Utilizing node as well as express, I have set up my web applications on AWS Ec2 Linux, running on ports 8080 and 8081 using pm2. I have also added subdomains to my Elastic IP - admin.example.com and app.example.com. Both of my applications are currently ...

Utilizing WSGI in conjunction with a Python/Flask application - A guide from HasGeek's Lastuser

Currently, I am in the process of setting up a lastuser OAuth server on my local machine. My plan is to configure Nginx with SSL (on port 443) and utilize the lastuser app as the WSGI server. If you want more details about the HasGeek lastuser project, ch ...

Ways to halt the expressjs server

After deploying my express and nextjs based app on EC2, I encountered an issue where the server automatically starts Nginx and node with different process IDs after I attempt to stop it by killing the process. This is happening even without using tools lik ...

Error 502 is being returned by the Nginx server for specific directories within the Express Application

Currently, I have an express application running on Ubuntu with nginx as the web server. Everything was functioning correctly until today when I attempted to add two new directories using the app.get method and re-deployed my app. Unfortunately, the new ...

Utilizing Nginx as a reverse proxy for dual Node.js applications sharing the same domain

Despite multiple attempts, I am struggling to find a solution for my issue. Recently, I set up an Ubuntu server to host two nodejs applications. Both apps are under the same domain mydomain.com but on different ports. One app is built using keystonejs whi ...

Utilizing Nginx for a single domain hosting two different applications - Ruby on Rails (RoR) and Node.js

Greetings. I've spent hours researching but haven't found any simple solutions to my current dilemma. Previously, I successfully deployed a RoR app on my server. Now, I'm looking to deploy a Nodejs app alongside it. These apps are unrelated and meant to ...

Unable to access API hosted on localhost from Angular Client integrated with C# Backend running on a standalone server unit

I have an Angular Client (v14) and a .Net 6 WebAPI running on separate projects within a Raspberry Pi. The setup is for a standalone kiosk where both the front end and backend are hosted on the same device. My goal is to access the front end from a PC on ...

Display a loading splash screen prior to loading Next.js

I am working on a NextJS website and I'm looking to incorporate a Splash Screen that displays before the site is fully loaded. However, since the Splash Screen is included in the NextJS code, it ends up loading after NextJS has rendered on the server and t ...

Chrome showing random 0 status for $http and $ajax requests

Occasionally, an issue arises on the website where the browser starts returning status 0 for XMLHTTPRequest requests randomly. This problem applies to requests made through both the jquery ajax function and the $http resource in angularJS. Curiously, the ...

Having trouble with the production deployment of a Dockerized React application

As I work on containerizing my create-react-app for production using a Dockerfile and Docker-compose.yml, I am facing a challenge in creating the production build. The issue arises from the fact that the scripts required to run the build command are listed ...

The website is functioning properly on port 8080, however, it is not working on the root directory

My website is functioning properly with the domain name test.in:8080, however it is not working on just test.in. Here is an excerpt from my nginx.conf file for reference: server { listen 80 default_server; listen [::]:80 defaul ...

Sending a cURL POST request to a Node.js express server running on an NGINX server resulted in a 502 error response

I am attempting to send a POST request to one of my node API routes. Strangely, only one of them seems to be working properly. I'm not certain whether this is an issue with NGINX, Node.js, or a combination of both. I have double-checked everything and ...

Error 502: Nginx's connection to the Express server is experiencing issues

Greetings! I recently migrated my website from AWS with PM2 to a nginx server on Digital Ocean. However, I am encountering a 502 error, indicating that something is misconfigured. Originally, the client was served successfully, but after switching to havin ...

In a particular configuration involving Docker and Nginx rewrite rules, there is a notable alteration in URLs that include question marks when utilized in jQuery.ajax calls

My PHP/Laravel app is running smoothly in a dockerized environment using the php:7.4-apache container. During development, we had it accessible through http://localhost:81. Now, our aim is to make this service available at http://localhost/foo/bar within ...

What are the steps to host a VueJS 3 application from subdirectories using NGINX?

I am facing a challenge in serving multiple VueJS 3 apps from the same NGINX server but from different subfolders. Despite exploring various resources on stack and the web, I have not been able to make things work seamlessly. In total, I have three apps e ...

Solving issues with Dreamhost, Passenger, and Django

I had a website that was successfully running on Dreamhost with Passenger and Django for many years. However, recently, without any notification, it seems that Dreamhost updated Passenger, causing my website to go down last Thursday. This is the installed ...

The static files are not loading on the Express/Nginx server

My Node.js app is having trouble loading static files in the browser, even though it works fine with curl. I am using nginx as my webserver. The application runs smoothly, but the static files are not loading. What could be the issue here? Here is a snipp ...

Nginx's sluggish SSL downloads at a snail's pace

I have configured this virtual host: server { server_name admin.ex.com ; listen 80 ; listen [::]:80 ; ##SSL #listen 443 ssl ; listen *:443 ssl http2 ; listen [::]:443 ssl http2 ; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #s ...

Creating a Dockerfile for Node8 and Nginx Integration

Greetings to everyone. I am facing an issue with a Dockerfile that has NODE 8, as it requires the installation of Nginx in the container for enabling gzip. However, the solution provided at https://dev.to/subhransu/nevertheless-subhransu-maharana-coded-5ea ...