我是个服务生,所以我可能搞错了这里发生的事情,以及如何解决这个问题,但无论如何。我有一个在3000端口上运行的节点服务器,并在我的域基础上服务。
server {
server_name blahblah.com www.blahblah.com; # managed by Certbot
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /test/ {
index index.html
root /var/www/html;
}
...我想添加一个新的静态位置(测试),它应该覆盖上面的proxy_pass设置,但是我认为/块正在消耗它之后的所有东西,因为当我访问/test时,它会带我到我的节点应用程序的自定义404页面。这件事能成功吗?
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful发布于 2021-02-04 19:18:08
不,location {}订单只对<>regexp位置(location ~ {})有效。普通(前缀)位置使用未定义规则进行匹配。
https://serverfault.com/questions/1052332
复制相似问题