65 lines
1.3 KiB
Plaintext
65 lines
1.3 KiB
Plaintext
# Default webserv configuration.
|
|
# Any '#' on a line means: everything from there to end of line is ignored.
|
|
#
|
|
# Syntax rules:
|
|
# - one line is exactly one thing: a block opener ("server {" /
|
|
# "location /path {"), a lone closing "}", or a single directive
|
|
# - there is no ';' terminator, so a closing "}" must sit alone on its
|
|
# own line and a directive's values are just the rest of its line
|
|
|
|
server {
|
|
listen 127.0.0.1:8080
|
|
listen 127.0.0.1:8081
|
|
server_name example.com www.example.com
|
|
|
|
root ./www
|
|
client_max_body_size 1M
|
|
|
|
error_page 404 ./www/errors/404.html
|
|
error_page 500 502 503 504 ./www/errors/50x.html
|
|
|
|
location / {
|
|
methods GET POST
|
|
index index.html
|
|
autoindex off
|
|
}
|
|
|
|
location /files {
|
|
methods GET
|
|
autoindex on
|
|
}
|
|
|
|
location /upload {
|
|
methods POST DELETE
|
|
upload_store ./www/uploads
|
|
}
|
|
|
|
location /old {
|
|
return 301 /
|
|
}
|
|
|
|
location /cgi-bin/python {
|
|
methods GET POST
|
|
cgi_extension .py
|
|
cgi_pass /usr/bin/python3
|
|
}
|
|
|
|
location /cgi-bin/php {
|
|
methods GET POST
|
|
cgi_extension .php
|
|
cgi_pass /usr/bin/php-cgi
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 0.0.0.0:8082
|
|
server_name second.local
|
|
|
|
root ./www2
|
|
|
|
location / {
|
|
methods GET
|
|
index index.html
|
|
}
|
|
}
|