-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
45 lines (38 loc) · 1015 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
events {
}
http {
include mime.types;
upstream backend{
server 127.0.0.1:1111;
server 127.0.0.1:2222;
server 127.0.0.1:3333;
server 127.0.0.1:4444;
}
server {
# listen 8080; #not mandatory
# root /data/www;
#include below location / for roundrobin, else, for static, root <location> is fine
location /{
root /data/www;
proxy_pass http://backend/;
}
location /fruits {
root /data/www;
# proxy_pass http://backend/; #getting the "Cannot GET //" error, which doesnt occur in the previous case.
}
location /carbs {
alias /data/www/fruits;
}
location /veggies {
root /data/www;
try_files /veggies/veg.html /index.html =404;
}
rewrite ^/fruit_basket /fruits;
# for redirect, but the link shows veggies instead of crops localhost/crops will return the contents of /veggies, but the address
#is shown as /veggies instead of /crops. to avoid , we use rewrite used above.
# location /crops {
# return 307 /veggies;
# }
rewrite ^/crop /veggies;
}
}