Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
nginx如何重写位置_Nginx - Fatal编程技术网

nginx如何重写位置

nginx如何重写位置,nginx,Nginx,我想要->, 如何编写我的位置配置 这是我的位置,但不起作用 location ^~ /health { root /usr/share/nginx/html; index health.html ; } location / { root /usr/share/nginx/html; index index.html index.htm; } 谢谢您的帮助。使用重写指令 location / { root /usr/share/ng

我想要->, 如何编写我的位置配置

这是我的位置,但不起作用

location ^~  /health {
    root   /usr/share/nginx/html;
    index  health.html ;
}

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
}

谢谢您的帮助。

使用
重写
指令

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;

    rewrite ^/heath/?$ /health.html? break;
}
资料来源: