Nginx
高速,軽量なウェブサーバ.2020年に全世界の利用率でApacheを上回ったらしい.
code:example.conf
server {
listen 80;
listen ::80:80 ipv6only=on; # これを忘れるとipv4とv6で挙動が変わってしまう server_name example.com; # これは一番忘れたらダメなやつ
server_tokens off;
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ =404;
error_page 404 /404.html;
location /watch {
if ($args ~ "v=(.*)") {
return 301 /watch/$1;
}
}
location /storage {
alias /usr/share/nginx/storage;
}
}