this need to be done to make it work in that default file
Configure nginx to serve API on /api subdirectory. Configure nginx to serve www/dist as static website.
Serving API using nginx
Create an upstream for API:
upstream api {
server 127.0.0.1:8080;
}
and add this setting after location /:
location /api {
proxy_pass http://api;
}
can you tell me what actual setting should i have to use in the default ngnix file
Sure, I can take a swing:
Replace the contents of your default file with this:
upstream api
{
server drowningpool.net:8080;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/dist; # <- This should be the absolute path to the files
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /api
{
proxy_pass http://api;
}
}