无效的url前缀nginx
嗨,我正在尝试用这个配置启动nginx无效的url前缀nginx,nginx,Nginx,嗨,我正在尝试用这个配置启动nginx server { listen 80; location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html; } location /graphql/ { proxy_pass http://localhost:18000/graphql; }
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /graphql/ {
proxy_pass http://localhost:18000/graphql;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
但我得到了这个错误
2019/09/06 14:23:22 [emerg] 1#1: invalid URL prefix in /etc/nginx/conf.d/nginx.conf:11
nginx: [emerg] invalid URL prefix in /etc/nginx/conf.d/nginx.conf:11
我不确定我遗漏了什么?不是重复的;另一张海报使用的是没有协议的unix套接字。这可能是相同的问题,但原因不同。是否存在非打印字符或字符编码问题?检查配置的十六进制/ASCII转储。如果您的uri已经是/graphql/如果您代理\u pass;它将带来整个uri,而不仅仅是“graphql”/graphql/foo/bar将在配置中代理传递给/graphql/而不是/graphql/foo/bar。