Welcome! Log In Create A New Profile


location vs. rewite

April 01, 2013 08:51AM
I want to server favicon from a different place rather than the root folder. As I explored I have two options

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

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 ?

location vs. rewite

etraderApril 01, 2013 08:51AM

Re: location vs. rewite

Anton YuzhaninovApril 01, 2013 08:58AM

Re: location vs. rewite

etraderApril 04, 2013 04:16AM

Re: location vs. rewite

locojohnMay 05, 2013 03:03PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 5 on August 04, 2015
Record Number of Guests: 244 on October 02, 2015
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready