I need your help, I have not been able to find the exact way to do this.
I would like to send my homepage ONLY to one proxypass location
location / {
proxy_pass http://website;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
And then send every other route (I won't know what they will all be, it will be dynamic) to another proxy pass.
location /* {
proxy_pass http://interaction;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
I know the * is wrong (since it doesn't work), but it was just to represent /anything or /whatever or /idontknowyet
Thanks for the help!
You are not clear as to which URIs constitute your homepage (other than /).
Assuming that no resource files are required, and no redirection occurs, an exact match location block can be used to match the homepage, using the default location block to match everything else:
location = / {
proxy_pass http://website;
...
}
location / {
proxy_pass http://interaction;
...
}
See this document for details.
But there are probably other URIs (such as css and js files) that make up the homepage. You will need to add location blocks for those too, or perhaps use a regular expression location block that matches all of the URIs required by the homepage.