This repository contains a simple Node.js Express application configured with Nginx as a reverse proxy.
- Node.js installed on your system
- Nginx installed on your system
- Basic understanding of Node.js and Nginx configurations
app.js
: Entry point of the Node.js Express application.package.json
: Contains project metadata and dependencies.nginx.conf
: Nginx configuration file for reverse proxy setup.
-
Clone the repository:
git clone https://github.com/TearsAchly/A387-Jarkom-Labs.git cd A387-Jarkom-Labs
-
Install Dependencies:
npm install
-
Start the Node.js Application:
npm start
This command will start the Node.js application on
http:https://localhost:8000
. -
Configure Nginx:
Edit your Nginx configuration file (
nginx.conf
) and add or replace the contents with the provided configuration to set up a reverse proxy for your Node.js application. -
Restart Nginx:
After configuring Nginx, restart the Nginx service to apply the changes.
sudo systemctl restart nginx
-
Access Your Application:
Open a web browser and navigate to
http:https://localhost:3000
. Nginx will reverse proxy requests to the Node.js application running on port 8000.
The Nginx configuration (nginx.conf
) includes:
limit_req_zone
: Rate limiting configuration to limit requests per IP address.- Proxy settings to pass requests from Nginx to the Node.js application:
proxy_pass
: Specifies the URL of the proxied server.proxy_set_header
: Sets headers passed to the proxied server.
- Ensure that both Node.js and Nginx are properly installed and configured on your system.
- Customize the Nginx configuration based on your application's requirements (e.g., SSL settings, gzip compression).
- For production deployments, consider security best practices and monitoring configurations.
This project is licensed under the MIT license. See the LICENSE file for more information.