search

Home  >  Q&A  >  body text

mesos - nginx reverse proxy configuration issue

There is a backend service http://10.18.35.158:8080
I want to use nginx reverse proxy

I want to achieve the following access method, that is, http: How to configure //ip/mesos and http://ip/marathon?

为情所困为情所困2780 days ago671

reply all(4)I'll reply

  • 阿神

    阿神2017-05-16 17:16:44

    Change location /mesos/ to location ~/mesos/(.)*
    Change location /marathon/ to location ~/marathon/(.)*
    Try it

    reply
    0
  • 黄舟

    黄舟2017-05-16 17:16:44

    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?

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 17:16:44

    upstream mesos_servers {
        server  192.168.0.2:5050;
    }
    upstream marathon_servers {
        server  127.0.0.1:8080;
    }
    
    server {
    
        listen 80;
        server_name xxx.com;
    
        location /mesos/ {
            proxy_pass http://mesos_servers/;
        }
    
        location /marathon/ {
            proxy_pass http://marathon_servers/;
        }
        location ~ ^/static/  {
            proxy_pass http://mesos_servers;
        }
    
    }
    

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 17:16:44

    /mesos/ Remove the trailing slash -> /mesos

    reply
    0
  • Cancelreply