Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Pronjaboy's avatar

Deploying Vue SPA with Node API via nginx

Hello!

I have and api and a spa, all the files are in my droplet at digital ocean already.

I am trying to configure my nginx. The api is functional, accepting all the requests. But the vue aplication does't work.

I have a folder namet restful.

Inside restful I have a folder named api and another named spa. My nginx is like this:

`server {

location / {
    proxy_pass http://localhost:5000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

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

root /root/restful/spa;
index index.html index.htm index.nginx-debian.html;

server_name;

location / {
    try_files $uri $uri/ =404;
}

}

´

0 likes
0 replies

Please or to participate in this conversation.