Node.js Nginx-将所有内容重定向到特定端点
我在配置Nginx以将所有请求重写到特定端点时遇到了一些麻烦 我有一个Nodejs应用程序运行在端口8080,我想所有的 *要求出示 我尝试过(在/etc/nginx/sites available/default文件中): 但我有500英镑。错误日志显示:Node.js Nginx-将所有内容重定向到特定端点,node.js,nginx,Node.js,Nginx,我在配置Nginx以将所有请求重写到特定端点时遇到了一些麻烦 我有一个Nodejs应用程序运行在端口8080,我想所有的 *要求出示 我尝试过(在/etc/nginx/sites available/default文件中): 但我有500英镑。错误日志显示: [error] 25756#0: *115803 rewrite or internal redirection cycle while processing "/statuscheck" 感谢您的帮助。您的rewrite指令中的正则表
[error] 25756#0: *115803 rewrite or internal redirection cycle while processing "/statuscheck"
感谢您的帮助。您的
rewrite
指令中的正则表达式也与/statuscheck
匹配,因此导致表达式多次求值的任何重写或重定向都将导致循环。这包括标志参数:last
、redirect
和permanent
但是,break
标志参数停止处理rewrite
指令,并继续处理当前位置内的URL。例如:
location / {
rewrite ^ /statuscheck break;
proxy_pass http://127.0.0.1:8080;
}
有关详细信息,请参阅。谢谢!那正是我想要的!
location / {
rewrite ^ /statuscheck break;
proxy_pass http://127.0.0.1:8080;
}