A
A
Alexey2018-08-21 16:04:42
Nginx
Alexey, 2018-08-21 16:04:42

Nginx doesn't allow Angular routing?

I have:
Domain - abcdef.com (NGINX virtual host)
When I switch to it, I get index.html (Angular). When clicking on a link on a page, for example abcdef.com/page, the page 'page' is displayed and everything works as expected. But if I enter this URL manually in the address bar of the browser or refresh the page, I get "404 Not Found - nginx/1.10.3 (Ubuntu)".
My NGINX config https://pastebin.com/v3iXxf2v
Tell me what needs to be fixed or added to make Angular routing work correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-08-21
@azovl

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.html;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question