nginx how can I rewrite a location -
i want http://localhost/health -> http://localhost/health.html , how can write location config?
this location ,but not work.
location ^~ /health { root /usr/share/nginx/html; index health.html ; } location / { root /usr/share/nginx/html; index index.html index.htm; }
thanks help.
use rewrite
directive.
location / { root /usr/share/nginx/html; index index.html index.htm; rewrite ^/heath/?$ /health.html? break; }
source: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite
Comments
Post a Comment