Sep 18, 2017
0
Level 1
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;
}
}
´
Please or to participate in this conversation.