Hi Guys,
Just starting out on NGiNX so I apologize if this is too basic. I am trying to configure NGiNX to route traffic to coming in to my server to different ports and different services based on the URL coming in. Then I want to take that and based on the user agent append low/med/high to the requested URL. I thought I had it but I keep getting errors when I put the coe in the config file. Any help would be very much appreciated.
EX) if (request comes *.images.domain.com/a.jpg)
{
if (user_agent ~ MSIE) {
change uri to *images.domain.com/MSIE/a.jpg
pass to a new port
}
My code:
if ($host ~* (.*).images.domain.com) {
if ($http_user_agent ~ MSIE) {
rewrite /images/(.*) /images/MSIE/(.*) break;
proxy_pass http://localhost:8080;}
}}
When I put that code in the config file I get an error that "if" is not a defined function.