Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Hosting frontend and backend on nginx

$
0
0

I am trying to host my AngularJs app and my dotnet core api on nginx but I'm unable to access my api, following is my default.conf in /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;}}

Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>