Conclusion: The poster probably made a mistake in the path behind the proxy. The access path behind the proxy is http://10.18.35.158:8080/meso... So the poster tried to access this path to see if it got 404, and then checked. Is it for other reasons?
Change location /mesos/ to location ~/mesos/(.)*
Change location /marathon/ to location ~/marathon/(.)*
Try it
Conclusion: The poster probably made a mistake in the path behind the proxy. The access path behind the proxy is http://10.18.35.158:8080/meso...
So the poster tried to access this path to see if it got 404, and then checked. Is it for other reasons?
/mesos/ Remove the trailing slash -> /mesos