try_files ( index index.html;) index.html . , try_files 2 . .
location = / {
root /usr/share/nginx/www.mydomain.com/public;
try_files /index.html /index.html;
}
:
curl -iL http://www.mydomain.com/index.html
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Sat, 16 Mar 2013 09:07:27 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: http://www.mydomain.com/
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 16 Mar 2013 09:07:27 GMT
Content-Type: text/html
Content-Length: 4
Last-Modified: Sat, 16 Mar 2013 08:05:47 GMT
Connection: keep-alive
Accept-Ranges: bytes
[ ]
'index', nginx . , , . , "index" "... "; . .
, . try_files . . , ,
index index.html;
rewrite ^/$ /index.html break;
"location/". "... "; nginx , . , , "index".
[ 2]
rewrite. . , ... break; . uri "/", nginx /index.html . index . .
location / {
root /usr/share/nginx/www.mydomain.com/public;
index index.html;
rewrite ^/$ /index.html break;
}