Skip to content

A web server built in C++ that emulates the behavior of the popular open-source web server, NGINX. This project was created with the goal of providing a deep understanding of the HTTP protocol and the inner workings of web servers.

Notifications You must be signed in to change notification settings

rvan-duy/42-webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-webserv

This is a web server that behaves similar to NGINX, a popular open-source web server. The goal of this project was to get a thorough understanding of the HTTP protocol and to get familiar with the workings of webservers.

Features

  • Supports HTTP/1.1
  • Serve static files (HTML, CSS, JavaScript, images, etc.)
  • Supports multiple virtual servers to reverse proxy requests to other servers
  • Supports python CGI scripts

Installation

Clone the repository:

git clone https://github.com/[USERNAME]/nginx-like-web-server.git

Compile the webserver through the makefile:

make

Run executable (optionally with path to a configuration file):

./webserver [OPTIONAL: path-to-configfile] 

Or run with default configuration through the makefile:

make run

Configuration

The server can be configured using a config file. The path-to-config file has to be added while running the server. Possible configurations:

  • Choose ports and servernames of virtual servers
  • Set up default error pages
  • Limit client body size
  • Set up routes with following possible configurations:
    • Define accepted HTTP methods
    • Set up HTTP redirections
    • Define root directory
    • Turn on/off directory listing
    • Setup index files
    • Execute CGI based on file extensions (currently only supports Python)

About

A web server built in C++ that emulates the behavior of the popular open-source web server, NGINX. This project was created with the goal of providing a deep understanding of the HTTP protocol and the inner workings of web servers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published