[Vuejs]-Partially using Vue with nginx

0👍

Here’s the solution. For some reason it needs 2 slashes in the root.

root /home/django/tradeium/frontend/dist//;
index index.html;

location / {
    include proxy_params;
    proxy_pass http://unix:/home/django/project/project.sock;
}

location = /custom/ {

    try_files $uri $uri/ index.html;
}

0👍

The following will serve the files inside /home/django/project/frontend/dist/ if the path of the request starts with ‘/custom/’

location /custom/ {
    root /home/django/project/frontend/dist/;
    index /index.html;
}

location / {
    include proxy_params;
    proxy_pass http://unix:/home/django/project/project.sock;
}

Leave a comment