Welcome! Log In Create A New Profile

Advanced

Re: Nginx rewrite rule for favicon.ico files

August 31, 2012 06:44AM
On Aug 31, 2012, at 14:28 , nexon wrote:

> Nginx rewrite rules for favicon.ico for multiple subdomains.
>
> In nginx /etc/sites-avaliable/vhost_config_file, I have the following
> rewrite rules for serving multiple subdomains with their favicon.ico files:
>
>
>
> if ($host = example1.example.com){
> rewrite ^/favicon.ico$ /favicon_example.ico break;
> }
>
> if ($host = example2.example.com){
> rewrite ^/favicon.ico$ /favicon_example.ico break;
> }
>
> if ($host = example3.example.com){
> rewrite ^/favicon.ico$ /favicon_example.ico break;
> }
>
>
> Please, how can I make this simple operation by adding **ONE GENERAL REWRITE
> RULE**:
>
> That rule must do:
>
> 1.For subdomains example1,example2... to check in location /images/$host.ico
> is there a favicon_example.ico file and serve it.
>
> 2.If there is no such file, than to serve just a plain favicon.ico file.
>
> Thank's in advance...

Why not to create a separate server block for each site instead of this
if/rewrite mess ?


--
Igor Sysoev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 06:28AM

Re: Nginx rewrite rule for favicon.ico files

Igor Sysoev August 31, 2012 06:44AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 07:27AM

Re: Nginx rewrite rule for favicon.ico files

Igor Sysoev August 31, 2012 07:34AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 07:44AM

Re: Nginx rewrite rule for favicon.ico files

Igor Sysoev August 31, 2012 08:30AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 09:10AM

Re: Nginx rewrite rule for favicon.ico files

Igor Sysoev August 31, 2012 10:02AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 10:50AM

Re: Nginx rewrite rule for favicon.ico files

Igor Sysoev August 31, 2012 10:58AM

Re: Nginx rewrite rule for favicon.ico files

Reinis Rozitis August 31, 2012 06:56AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 09:13AM

Re: Nginx rewrite rule for favicon.ico files

VBart August 31, 2012 09:20AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 10:52AM

Re: Nginx rewrite rule for favicon.ico files

Mark Alan August 31, 2012 09:16AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 09:31AM

Re: Nginx rewrite rule for favicon.ico files

nexon August 31, 2012 10:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready