Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
/ webserv Public archive

A functional web server built in C++.

Notifications You must be signed in to change notification settings

dcdnce/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webserv

A functional web server built in C++ for the 42 school common core.

Non-blocking I/O with select for multiplexing, RFC-Compliant HTTP request parsing and response construction, and more. Configurable via .conf files.

server {
listen 80
server_name localhost
error_page 400 ./www/errors/400.html
error_page 403 ./www/errors/403.html
error_page 404 ./www/errors/404.html
error_page 405 ./www/errors/405.html
error_page 500 ./www/errors/500.html
error_page 501 ./www/errors/501.html
error_page 504 ./www/errors/504.html
client_max_body_size 5M
location / {
root ./www/
index index.html
}
location /cgi/ {
root ./cgi/
cgi .py /Users/mrattez/.brew/bin/python3
cgi .pl /usr/bin/perl
upload_path ./www/upload/
accepted_methods GET POST
}
location /uploads/ {
root ./www/upload/
autoindex on
accepted_methods GET DELETE
}
location /youtube/ {
return 301 https://www.youtube.com/
}
location /google/ {
return 301 https://www.google.com/
}
}