Search code examples
apachewebservernetflix-zuul

Routing HTTP static content requests through Zuul


I have a Microservice project which uses Zuul as a gateway for API requests. The User Interface web content is hosted on an Apache HTTP server outside Zuul.

Now I would like to route the Web server content through Zuul instead of exposing the service directly

How can I do this?

Zuul does not seem to support web content routing to Apache Server. I have read that this can be done by hosting it and exposing the web content as a Spring project...but that is too overkill

Please let me know if any solutions exist


Solution

  • After fiddling around I was finally able to achieve this

    First I built the angular application like this

    ng build --deploy-url appgateway/ --base-href ui/
    

    which would add an appgateway prefix before the static content urls

    After that I configured route in zuul configuration like this

    routes:
      ui:
        path: /ui/**
        url: http://localhost:8080/ui/
        stripPrefix: false
    

    Finally I was able to access the application though gateway URL at

    http://localhost:8090/appgateway/ui/