Adds an nginx reverse proxy container in your environment, with automatically generated configuration to forward http requests to all other webapps in the envirvonment
This allows you to avoid cross-domain limitations in browsers.
<dependency>
<groupId>com.github.swissquote</groupId>
<artifactId>carnotzet-extension-reverse-proxy</artifactId>
<version>${carnotzet-extension-reverse-proxy.version}</version>
</dependency>
register a ReverseProxyExtension object in your CarnotzetConfig (Carnotzet documentation for details)
<plugin>
<groupId>com.github.swissquote</groupId>
<artifactId>zet-maven-plugin</artifactId>
<version>${carnotzet.version}</version>
<configuration>
<extensions>
<extension>
<factoryClass>com.github.swissquote.carnotzet.extension.reverse.proxy.ReverseProxyExtensionFactory</factoryClass>
</extension>
</extensions>
</configuration>
<dependencies>
<dependency>
<groupId>com.github.swissquote</groupId>
<artifactId>carnotzet-extension-reverse-proxy</artifactId>
<version>${carnotzet-extension-reverse-proxy.version}</version>
</dependency>
</dependencies>
</plugin>
By default, the latest nginx official docker image will be used as reverse proxy. You can override this by using the appropriate constructor when building your ReverseProxyExtension. When configuring through the maven plugin, you may use the nginx.image property.
By default, the module name is used as contextPath. you can override the contextPath of each webapp in their respective carnotzet.properties file.
http.context.path=/custom-context
By default, the reverse proxy forwards requests to port 80 of each container. you can override the contextPath of each webapp in their respective carnotzet.properties file.
http.port=8080