我是Nginx的新手,只是尝试做一些我认为应该很简单的事情.如果我做:-
卷曲http://localhost:8008/12345678
我希望会返回index.html页面.但相反,我得到404未找到. /usr/share / Nginx / html / 12345678没有这样的文件
如果我卷曲http://localhost:8008/,我希望将请求路由到http://someotherplace/,但我却找到302,就这样.
对于基本问题深表歉意,但不胜感激!
这是代码:
server {
listen 8008;
server_name default_server;
location / {
rewrite ^/$http://someotherplace/ redirect;
}
location ~ "^/[\d]{8}" {
rewrite ^/$/index.html;
root /usr/share/Nginx/html;
}
}