Welcome! Log In Create A New Profile

Advanced

Use NGINX with Angular production with direct access to pages

Posted by xdavidt 
Use NGINX with Angular production with direct access to pages
May 06, 2021 08:09AM
Here is my code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
server {
listen 80;
listen [::]:80;

root /home/ubuntu/iot-web/;
index index.html index.htm index.nginx-debian.html;

server_name domain.net www.domain.net;

location /api/ {
proxy_pass http://localhost:8080/api/;
}

location /auth/login {
root /home/ubuntu/iot-web/;
index index.html index.htm index.nginx-debian.html;
}


location / {
try_files $uri $uri/ =404;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
After access to domain.net, user re-direct to domain.net/auth/login and then login to dashboard.
But if the user access directly to 'domain.net/auth/login' it getting "404 Not Found", Why is that? how to fix it ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 293
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready