53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
# Default configuration loaded when no configuration path is provided.
|
|
|
|
server {
|
|
listen 0.0.0.0:8000;
|
|
server_name localhost;
|
|
|
|
root ./www;
|
|
index index.html;
|
|
client_max_body_size 1m;
|
|
|
|
error_page 404 /errors/404.html;
|
|
error_page 500 502 503 504 /errors/50x.html;
|
|
|
|
location / {
|
|
allow_methods GET;
|
|
}
|
|
|
|
location /files {
|
|
allow_methods GET DELETE;
|
|
autoindex on;
|
|
}
|
|
|
|
location /upload {
|
|
alias ./www/uploads;
|
|
allow_methods GET POST DELETE;
|
|
upload_store ./www/uploads;
|
|
client_max_body_size 10m;
|
|
}
|
|
|
|
location /old {
|
|
return 301 /;
|
|
}
|
|
}
|
|
|
|
# Both server blocks share one listening socket because they use the same
|
|
# endpoint. The Host header selects a block, and the first one is used when no
|
|
# server name matches.
|
|
#
|
|
# A browser needs the "127.0.0.1 webserv.local" entry in /etc/hosts.
|
|
# curl can supply that mapping for one request:
|
|
# curl --resolve webserv.local:8000:127.0.0.1 http://webserv.local:8000/
|
|
server {
|
|
listen 0.0.0.0:8000;
|
|
server_name webserv.local;
|
|
|
|
root ./www/vhost;
|
|
index index.html;
|
|
|
|
location / {
|
|
allow_methods GET;
|
|
}
|
|
}
|