Description
Nginx is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.Examples
Dependency:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-nginx</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>
Usage:
var nginx = new NginxContainer(DockerImageName.parse("nginx:1.23.4-alpine"));
nginx.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/nginx
Usage:
nginxContainer, err := nginx.Run(context.Background(), "nginx:1.25.3")
Dependency:
pip install testcontainers[nginx]
Usage:
with NginxContainer() as nginx:
url = f"http://{nginx.get_container_host_ip()}:{nginx.get_exposed_port(nginx.port)}/"