Why do I get an error when opening my MATLAB Web App Server application behind a proxy without sticky sessions?

I have multiple MATLAB Web App Servers (R2026a) running behind a reverse proxy. I have deployed my application to all of the servers and am accessing it via the reverse proxy but am running into an error when opening the application:
Cannot execute "tutorialApp" app.
Verify that the app exists and that you are authorized to execute the app.
Return to the gallery.
What can I do to resolve this issue?

 Accepted Answer

This issue can happen when proxying in front of multiple servers and not using sticky sessions. Sticky sessions ensure that the user is "stuck" to one single server for their current session.
If using Nginx, you can try using "ip_hash" (will select the server based on IP) and see if that resolves the issue.
events {}
http {
upstream <web-apps-hosts> {
ip_hash;
server <hostname1>:<port1>;
server <hostname2>:<port2>;
}
server {
listen 0.0.0.0:<port>;
server_name localhost;
location / {
proxy_pass http://<web-apps-hosts>;
}
}
}
Sticky sessions have been tested for IP hashes with Nginx, but certain setups may benefit more from other techniques, such as cookies. It can also be beneficial to use round robin scheduling, which has the load balancer direct requests to the servers in a round robin/circular manner.

More Answers (0)

Categories

Find more on MATLAB Web App Server in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!