Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

location vs. rewite (1 reply)

$
0
0
I want to server favicon from a different place rather than the root folder. As I explored I have two options

1.
location = /favicon.ico { alias /var/www/media/images/favicon.X.ico; }

2.
rewrite ^/favicon.ico /var/www/media/images/favicon.X.ico last;

As I understand the second one needs an additional regex check for every request to check if the url is favicon or not (imagine that we have a rewite of ^/(.*)\.(.*) and thus the favicon rewite must be first).

How the location works? Does it also should be checked on every request?

In general, which solution is better ?

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>