47 lines
1002 B
Nginx Configuration File
47 lines
1002 B
Nginx Configuration File
events {}
|
|
|
|
http {
|
|
# TODO Z3.3:
|
|
# Dodaj rate limiting zonu u ovaj http blok:
|
|
# limit_req_zone $binary_remote_addr zone=api:10m rate=5r/s;
|
|
|
|
upstream users_api {
|
|
server users-api:3001;
|
|
}
|
|
|
|
upstream orders_api {
|
|
server orders-api:3002;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
|
|
location = /auth/login {
|
|
proxy_pass http://users_api/auth/login;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location /api/users {
|
|
# TODO Z3.3:
|
|
# Dodaj u ovaj location:
|
|
# limit_req zone=api burst=10 nodelay;
|
|
# limit_req_status 429;
|
|
|
|
proxy_pass http://users_api/api/users;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Authorization $http_authorization;
|
|
}
|
|
|
|
location /api/orders {
|
|
# TODO Z3.3:
|
|
# Dodaj u ovaj location:
|
|
# limit_req zone=api burst=10 nodelay;
|
|
# limit_req_status 429;
|
|
|
|
proxy_pass http://orders_api/api/orders;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Authorization $http_authorization;
|
|
}
|
|
}
|
|
}
|