chovy
chovy

Reputation: 75666

rewrite all requests except assets and favicon.* in nginx (for angular app)

I'm currently rewriting each page to /index.html but that is going to be messy to maintain.

rewrite ^/(about)$  /index.html last;

I'd rather do something like:

rewrite ^/!(assets|favicon.*)$  /index.html last;

Upvotes: 1

Views: 911

Answers (1)

anubhava
anubhava

Reputation: 785068

Can you try this regex:

rewrite ^/(?!assets|favicon) /index.html last;

Upvotes: 4

Related Questions