Angular UI’larının nginx ile çalışması için, yönlendirmenin çalışmasına izin vermek amacıyla normalde 404 döndüreceğiniz herhangi bir URL için index.html yüklemeniz gerekir:
nginx_angular_try_files.conf
location / {
try_files $uri $uri$args $uri$args/ /index.html;
}API’li varsayılan site için tam örnek:
nginx_angular_full.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html;
server_name MyServer;
location / {
try_files $uri $uri$args $uri$args/ /index.html;
}
location /api {
proxy_pass http://localhost:8080;
}
}
Check out similar posts by category:
Nginx
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow