Ngix with multiple angular designs

Asked

Viewed 43 times

-1

Hello, I’m starting now to use the NGINX and I’ve already had a problem!

I am using an ubundo server to run 3 angular frontends, and then I am using NGINX to resect these projects

The setup I’m doing is as follows!

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name dominio.com.br www.dominio.com.br;

    index index.html index.htm index.nginx-debian.html;

    # Accounts Portal
    location / {
            alias /fover-repository/accounts-portal/dist/BookingAccountsPortal/;
            try_files $uri /index.html;
    }

}

This way if I access the link directly this way: 'www.dominio.com.br', works very well!

But what I want is to access this project with the following route: 'www.dominio.com.br/Accounts'.

When I place in Location the following way:

location /accounts/ {
        alias /fover-repository/accounts-portal/dist/BookingAccountsPortal/;
        try_files $uri /index.html;
}

I get 404 Not Found.

How can I fix this?

Thank you in advance...

1 answer

0

In case someone is having the same problem! I solved my problem by removing the index.html file from the angular project, the following tag!

How was:

<base href="/">

As it turned out:

<base href="">

With that, it worked perfectly

Browser other questions tagged

You are not signed in. Login or sign up in order to post.