gawati / gawati-portal-ui

Version 2 of the gawati portal
GNU Affero General Public License v3.0
0 stars 0 forks source link

Remove service level reverse proxy mappings #24

Closed kohsah closed 6 years ago

kohsah commented 6 years ago

In Gawati we have multiple service components, each providing multiple services. Currently each individual service is mapped via an indidividual reverse proxy mapping in apache config. We do this to map all the services under a common application domain - which makes doing things like authentication easier without doing cross domain requests and setting up CORS in individual services. This also means every time a new service is added we need to add a reverse proxy config for it, and use that proxied request path across all the application components accessing that service.

There may be 10-15 proxy config mappings at the moment, but this is expected to increase going ahead, and it makes more sense to have a more standard way of accessing services.

The proposed mechanism is to use wild-cards to map services -

e.g. services provided by gawati-portal-server will under the /gwp folder ; services provided by gawati-data will be under the /gwd folder ; services provided by gawati-auth will be under the /gwa folder ;

The individual services will not be described in apache config, but will be mapped direclty using wildcads. This emans each individual service component is responsible for naming its services, currently these names are overriden at the reverse proxy config level, but that is a complexity that will possibly become more difficult to manage going ahead.

kohsah commented 6 years ago

See below, with this simplified wildcard based mapping, we will only have 3 mappings as opposed 10+ earlier.

<Location ~ "/gwd/(.*)">
  AddType text/cache-manifest .appcache
  ProxyPassMatch  "http://localhost:8080/exist/restxq/gw/$1"
  ProxyPassReverse "http://localhost:8080/exist/restxq/gw/$1"
  ProxyPassReverseCookiePath /exist /
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1
</Location>

<Location ~ "/gwp/(.*)">
  AddType text/cache-manifest .appcache
  ProxyPassMatch  "http://localhost:9001/gwp/$1"
  ProxyPassReverse "http://localhost:9001/gwp/$1"
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1
</Location>

<Location ~ "/gwc/(.*)">
  AddType text/cache-manifest .appcache
  ProxyPassMatch  "http://localhost:9002/gwc/$1"
  ProxyPassReverse "http://localhost:9002/gwc/$1"
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1
</Location>