Q:

Static files setting in Nginx？

I want 'www.mydomain.com/images/20151111/test.jpg' could be visit
And I am sure the 'test.jpg' is realy exist.
but It shows 404 not found.
Here is my nginx setting.
server {
    listen  80;
    server_name www.mydomain.com;
    index index.html
    root /home/googleimage;

    location / {
        uwsgi_pass  unix:///tmp/pic.sock;
        include     uwsgi_params;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
            {
                root /home/wechat;
                    expires      30d;
            }

    location /images/ {
        alias /home/images/;
    }

}

The 'test.jpg' in this floder 
/home/images/20151111/test.jpg
what was wrong? 

A:

The URI /images/20151111/test.jpg matches your regex location first, as this takes precedence. To make your prefix location take precedence write is as:
location ^~ /images/ {
  alias /home/images/;
}

See this document for location syntax and usage.

