I have some static files, that I can already access, and I have an api, already at digital ocean.
But I am having some troble configuring NGINX to access both at the same time. If my api works, the static files don't. And vice-versa;
My api is running on port 5000, and I want to access the site and the api by IP adress.
Pls, help!
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
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;
}
}