I'm trying to set up what might be the "hello world" of proxy pass redirects. It entails a default route, and one single conditional route.
I want all of the traffic to my server to proxy some ip 1.2.3.4 unless it matches /blog
in which case it should proxy 5.5.5.5
I've spent some time guessing and checking with the config, and read a bunch of docs, but the amount of variance is overwhelming, and I can't seem to find an anchor point of even a single fully functional simple example to seed from. So far, this is what I think should work:
http {
server {
listen 80;
location / {
proxy_pass 1.2.3.4
}
location ~ /blog {
proxy_pass 5.5.5.5
}
}
}
I've updated the config like so and reloaded without any errors, but when I navigate to the server I just get the default Welcome to nginx!
landing page.
What am I missing here?