我对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;
}
}