Skip to content

Hosting elasticvue on a subdirectory

Carsten König edited this page Mar 10, 2024 · 1 revision

You have to manually build elasticvue if you want to host it on a path like example.com/elasticvue.

Simply set the VITE_APP_PUBLIC_PATH environment variable when building, e.g. when adjusting the Dockerfile:

RUN VITE_APP_BUILD_MODE=docker VITE_APP_PUBLIC_PATH=/elasticvue/ yarn build

Depending on your setup you also have to adjust your webserver config. Using nginx might look like this:

server {
  listen 8080;
  server_name _;
  root /usr/share/nginx/html;

  location ^~ /elasticvue {
    alias /usr/share/nginx/html;
    try_files $uri $uri/ /index.html?$args;
  }
}
Clone this wiki locally