Хостинг фронтенд и бэкэнд на nginx - PullRequest
0 голосов
/ 06 сентября 2018

Я пытаюсь разместить мое приложение AngularJs и мой API-интерфейс ядра dotnet на nginx, но я не могу получить доступ к своему API-интерфейсу, вот мой default.conf в /etc/nginx/conf.d:

server {

listen 80 default_server;
listen [::]:80 default_server;

root /var/www/dashboard;

index index.html;

server_name example.server.com;

location / {
     try_files $uri /index.html;
}

location /api {
 proxy_pass http://localhost:5000;
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection keep-alive;
 proxy_set_header Host $host;
 proxy_cache_bypass $http_upgrade;
}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

}
...