Issue
- If we are removing the /o/ from URLs, they are not recognised anymore.
Environment
- Liferay DXP 7.1+
Resolution
-
You can create a hostname e.g. api.something.com and have Apache (or Nginx) do the proxy pass to Liferay with /o.
Below is a sample configuration could be implemented e.g. on localhost
httpd.conf extract:
<VirtualHost *:80>
ServerName api.localhost
ProxyTimeout 300
ProxyRequests on
ProxyPreserveHost On
<Location />
ProxyPass http://localhost:8080/o/
ProxyPassReverse http://localhost:8080/o/
</Location>
</VirtualHost>
With this setting API can be accessed as the following URL:
http://api.localhost/headless-delivery/v1.0/sites/20121/content-elements
Instead of http://localhost:8080/o/headless-delivery/v1.0/sites/20121/content-elements
Conteúdo Excluesivo para Assinantes
Uma Subscrição do Liferay Enterprise fornece acesso a mais de 1.500 artigos que incluem práticas recomendadas, solução de problemas e outras soluções valiosas. Faça login para obter acesso completo.
Entrar