Post-Installation

Secure the files access

With the likpiadm user, restrict access to configuration files that contain critical information such as database credentials and application secrets.

$ chmod 600 /opt/likpi/cmdb-backend/config.json

Configure Nginx

Basic configuration for testing

With the administrator user:

Edit the file /etc/nginx/sites-available/default and add these entries with the support of your Linux administrator. This configuration serves the React frontend and proxies API requests to the Java backend.

server {
    listen 40080 default_server;
    listen [::]:40080 default_server;

    root /opt/likpi/cmdb-frontend/html/;
    server_name _;
    index index.html;

    # Serve the React Single Page Application (SPA)
    location / {
        try_files $uri $uri/ /index.html;
    }

    # Route API traffic to the backend Vert.x application
    location /api/ {
        proxy_pass http://localhost:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}


Note

Adjust the proxy_pass directive to point to the correct IP address if your Likpi CMDB backend is hosted on a different node.


SSL connection

To enable HTTPS secure connection with your certificates, edit the file /etc/nginx/sites-available/default and add these entries with the support of your Linux administrator:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name cmdb.yourdomain.com;
    return 301 https://$server_name$request_uri;  # Redirect HTTP to HTTPS
}

server {
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    root /opt/likpi/cmdb-frontend/html/;
    index index.html index.htm;

    server_name cmdb.yourdomain.com;

    ssl_certificate /opt/likpi/security/fullchain.pem;
    ssl_certificate_key /opt/likpi/security/privkey.pem;

    # Other SSL settings (protocols, ciphers) as in Likpi docs
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers off;
    ssl_session_cache shared:SSL:10m;

    # Serve the React Single Page Application (SPA)
    location / {
        try_files $uri $uri/ /index.html;
    }

    # Route API traffic to the backend Vert.x application
    location /api/ {
        proxy_pass http://localhost:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Note

The SSL configuration example above can be adapted to your context. Ensure that your DNS records match the server_name and that your Nginx worker process has read access to the certificate files.