Files
hse-2026/materials/03-http/seminar/website/nginx.conf
T
2026-09-24 21:25:39 +03:00

49 lines
1.1 KiB
Nginx Configuration File

events {}
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
server {
listen 80;
server_name distsys.baliuk.me;
location /kittens {
proxy_pass http://backends;
add_header X-Upstream $upstream_addr;
}
location = / {
proxy_pass http://backends;
add_header X-Upstream $upstream_addr;
}
location /search/ {
rewrite ^/search/(.*)$ https://google.com/search?q=$1 redirect;
}
location = /const {
add_header Content-Type text/plain;
return 200 "Any preset text!";
}
}
upstream backends {
server server1:5001;
server server2:5002;
}
server {
listen 10000;
autoindex on; # enable directory listing output
autoindex_exact_size off; # output file sizes rounded to kilobytes, megabytes, and gigabytes
autoindex_localtime on; # output local times in the directory
location / {
root /static;
}
}
}