nginx配置如下,为什么图3这样访问会报错呢?

图片一可以正常访问

图片2是nginx的配置

图片3为什么访问报错

阅读 1.3k
2 个回答

proxy_pass

A request URI is passed to the server as follows:

  • If the proxy_pass directive is specified with a URI, then when a request is passed to the server, the part of a normalized request URI matching the location is replaced by a URI specified in the directive
location /name/ {
    proxy_pass http://127.0.0.1/remote/;
}
  • If proxy_pass is specified without a URI, the request URI is passed to the server in the same form as sent by a client when the original request is processed, or the full normalized request URI is passed when processing the changed URI:
location /some/path/ {
    proxy_pass http://127.0.0.1;
}

你的配置问题, proxy_pass http://110.42.139.52:9080/nginx_demo/a/

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题