NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.
Issue
- Customers may wish to test Nginx webserver service configuration changes without affecting their Liferay PaaS environments, for example:
- Testing new or updated .conf files to add additional headers or turn off Gzip.
- Testing custom scripts.
Environment
- Liferay PaaS
Resolution
- The docker images used by the Liferay PaaS platform are available from Docker Hub > Liferay Cloud, meaning the webserver service can be run outside of Liferay PaaS using Docker Desktop or similar tool.
- The webserver service config folder from the webserver service can be injected into the docker container as follows (sample window command):
docker run -p 80:80 -e LCP_PROJECT_ENVIRONMENT=dev -e LCP_PROJECT_ID=local -e LCP_PROJECT_UID=local -v c:/temp/configs:/lcp-container/configs:ro liferaycloud/nginx:1.24.0-6.1.4
-
liferaycloud/nginx:1.24.0-6.1.4 is the service version from the webserver LCP.json file.
-
c:/temp/configs is the webserver service configs folder location to inject in.
-
LCP_PROJECT_ENVIRONMENT=dev determines the Liferay PaaS environment configuration to be used - in this case dev. This will provide the configs, scripts and public folders, with 'dev' on top of 'common' in this example.
Additional Information
- The files from the configs folder are visible within the container from Docker Desktop > container > files > etc/nginx
- The traffic will be on port 80 as you won't have the Liferay PaaS Loadbalancer to handle HTTPS.