Skip to content

Main Contents and Concepts of Carapace Proxy

Paolo Venturi edited this page Jun 18, 2019 · 11 revisions

Intro

This is a simple draft about main contents and concepts of Carapace Proxy, what it does and how.

Components

Listeners

Listeners are the entrypoints of the reverse proxy for incoming connections. You need to configure them by specifying the host and port where to listen for.

Routes

Routes are the way you tell the proxy what to do when an incoming connection (at a Listener) is established. Each route features a match property for mapping incoming http requests to the proper action we want to be perform, according to a set of rules (matching conditions) we define over some properties of the Request.

For more details about composing matching conditions see Matching Expression Language.

Actions

Up to now 4 different types of Actions exist:

  • static: used to serve a static resource (file);
  • proxy: used to redirect the incoming connection to the first available backend from those specified by the action director;
  • cache: like proxy action but with "cache resources" management. Up to now cached resources are images (png, gif, jpg, jpeg), scripts (js), stylesheets (css) and fonts (woff2).
  • redirect: used to perferom an HTTP Redirect for the incoming connection to a specified host and/or port and/or uri. By this kind of action you can also force non secure connections redirection to secure ones.

By default, whether you do not want/need to define your own actions, Carapace provides a basic set of most commonly used:

  • proxy-all: type proxy and default director (*);
  • cache-if-possible: type cache and default director (*);
  • not-found: type static, and default not-found page;
  • internal-error: type static, and default internal-error page.

Directors

Used in actions of type proxy and cache, directors define to which backends (by common separated ids) perform connection proxing.

Backends

Are the services that you want to expose to the internet and to hide behind the proxy. All you need to define is the id, hostname, port and whether it's enable.