Welcome! Log In Create A New Profile

Advanced

Re: serve static content on static domain

Valentin V. Bartenev
April 11, 2012 06:32AM
On Wednesday 11 April 2012 11:06:21 zuckbin wrote:
> ok, can i do this ?

Sure, you can. But, please, take a look at this links:

http://wiki.nginx.org/IfIsEvil
http://wiki.nginx.org/Pitfalls
http://nginx.org/en/docs/http/request_processing.html
http://nginx.org/r/location

[...]
>
> server {
> listen ip:80;
> server_name static.static-yourserver.com;
> root /srv/http/nginx/yourserver.com;
> location / {
> if ($request_filename ~
> "\.(jpg|css|gif|png|swf|ico|mp3)$") {
> break;
> }
> return 404;
> }
> }
>

Then you will understand how to write good configuration:

server {
listen ip:80;
server_name static.static-yourserver.com;
root /srv/http/nginx/yourserver.com;

location / {
return 404;
}

location \.(?:jpg|css|gif|png|swf|ico|mp3)$ {

}
}

wbr, Valentin V. Bartenev

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

serve static content on static domain

zuckbin April 06, 2012 09:41AM

Re: serve static content on static domain

Edho Arief April 06, 2012 09:48AM

Re: serve static content on static domain

zuckbin April 10, 2012 03:47AM

Re: serve static content on static domain

Valentin V. Bartenev April 10, 2012 04:54AM

Re: serve static content on static domain

zuckbin April 11, 2012 03:06AM

Re: serve static content on static domain

Valentin V. Bartenev April 11, 2012 06:32AM

Re: serve static content on static domain

Valentin V. Bartenev April 11, 2012 06:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready