Nginx is a web server, reverse proxy and mail proxy and http cache.
The following example shows how to start Nginx.
Creating a Nginx container inside_block:creatingContainer
How to add custom content to the Nginx server.
Creating the static content to serve inside_block:addCustomContent
And how to query the Nginx server for the custom content added.
Creating the static content to serve inside_block:getFromNginxServer
Add the following dependency to your pom.xml/build.gradle file:
=== "Gradle"
groovy testImplementation "org.testcontainers:nginx:{{latest_version}}"
=== "Maven"
xml <dependency> <groupId>org.testcontainers</groupId> <artifactId>nginx</artifactId> <version>{{latest_version}}</version> <scope>test</scope> </dependency>