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
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In