webserv/config/default.conf
Quinten 0887acd81a feat(config): add new server configuration for site-3 and implement CGI support
feat(site-3): create index.php for site-3 with a greeting message
refactor(client): change setCgiSocket to accept unique_ptr for better memory management
fix(AConfig): adjust getCGIPath to correctly prepend dot to extension
refactor(CgiProcess): update CGI process handling to use unique_ptr for CgiSocket
refactor(URI): enhance logging for CGI checks and improve condition checks
refactor(Router): clean up commented code and add debug logging for CGI process
fix(Server): improve error logging for epoll_ctl failures
2025-10-15 17:03:49 +02:00

119 lines
2.5 KiB
Plaintext

autoindex on
error_page 400 ./htdocs/error_pages/400.html
error_page 500 ./htdocs/error_pages/500.html
server {
listen 8080;
host 0.0.0.0;
server_name localhost;
root ./htdocs/site-1/;
index index.html index.htm;
error_page 400 ./htdocs/error_pages/400.html;
error_page 404 ./htdocs/error_pages/404.html;
error_page 403 /403.html;
error_page 404 /404.html;
error_page 405 /405.html;
error_page 413 /413.html;
error_page 500 /500.html;
error_page 502 /502.html;
error_page 504 /504.html;
client_max_body_size 1M;
location / {
autoindex off;
root ./htdocs/site-1/;
index index2.html index.html;
allowed_methods GET POST DELETE;
}
# location /uploads {
# root /var/www/uploads;
# autoindex on;
# allowed_methods GET POST;
# }
location /images {
root ./htdocs/site-1/img;
autoindex off;
index index.jpg;
allowed_methods GET;
}
# cgi_enabled yes;
# cgi_ext .php /usr/bin/php-cgi;
}
server {
listen 8081;
host 127.0.0.1;
server_name localhost;
root ./htdocs/site-2/;
index index.html index2.htm;
error_page 400;
error_page 403 /403.html;
error_page 404 /404.html;
error_page 405 /405.html;
error_page 413 /413.html;
error_page 500 /500.html;
error_page 502 /502.html;
error_page 504 /504.html;
client_max_body_size 1M;
location / {
autoindex off;
root ./htdocs/site-2/;
index index.html;
allowed_methods GET POST DELETE;
}
# location /2uploads {
# root /var/www/uploads;
# autoindex on;
# allowed_methods GET POST;
# }
# location /2images {
# root /var/www/images;
# autoindex off;
# index index.jpg;
# allowed_methods GET;
# }
# cgi_enabled yes;
cgi_ext .php /usr/bin/php-cgi;
}
server {
listen 8082;
host 127.0.0.1;
server_name localhost;
root ./htdocs/site-3/;
index index.html index2.htm;
error_page 400;
error_page 403 /403.html;
error_page 404 /404.html;
error_page 405 /405.html;
error_page 413 /413.html;
error_page 500 /500.html;
error_page 502 /502.html;
error_page 504 /504.html;
client_max_body_size 1M;
location / {
autoindex off;
index index.php;
allowed_methods GET POST DELETE;
}
cgi_enabled yes;
cgi_ext .php /usr/bin/php-cgi;
}