Issue
- We need to implement a rewrite rule that change the URL in a client request from www.mydomain.com to mydomain.com.
- How should we proceed to configure this in our PaaS environment?
Environment
- Liferay PaaS
Resolution
WARNING! The below solution represents only a hint. Portal administrators shall perform NGINX configurations at their own discretion. Liferay Support is limited in assisting with the below topic.
- Following the Nginx official documentation, you may be able to achieve the desired behavior by adding the following configuration to your
nginx.conf
file:
server {
listen 80;
server_name www.mydomain.com;
return 301 $scheme://mydomain.com$request_uri;
}