How to modify API URL?


  • If we are removing the /o/ from URLs, they are not recognised anymore.


  • Liferay DXP 7.1+


  • You can create a hostname e.g. 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/

    With this setting API can be accessed as the following URL:
    Instead of http://localhost:8080/o/headless-delivery/v1.0/sites/20121/content-elements


Este artigo foi útil?
Utilizadores que acharam útil: 0 de 0