I want to deploy my nodejs application that contains backend and frontend for my application in openlitespeed.
I run both of them using pm2 autorunner and get the port that i setup earlier (For example i using port 8080). How can i use reverse proxy like nginx in openlitespeed? is there are step by step to do that?
i expect it to run in url like this localhost/downtime-app without using port
Actually i already set my index.html of my frontend to configured like php but when i refresh the page it will return page error 503, and i already add .htaccess in directory of my builded nodejs fe but it not working, so i want to use reverse proxy if it possible.
Adjust the port (80) if you want to use a different port for Nginx.
Restart Nginx for the changes to take effect.
3. Access Your Application:
Open your web browser and navigate to http://localhost/downtime-app. Your Node.js application should now be accessible without using the port number.
Explanation:
OpenLiteSpeed acts as a web server, handling incoming requests and passing them to the Node.js application running on port 8080.
Nginx acts as a reverse proxy, intercepting requests for the downtime-app path and forwarding them to OpenLiteSpeed.
The .htaccess file in your Node.js application’s public directory is not required when using Nginx as a reverse proxy.
By following these steps, you should be able to successfully deploy your Node.js application using OpenLiteSpeed and Nginx as a reverse proxy, allowing you to access your application without using the port number.