業務背景是這樣 對于所有的api請求(例如:http://www.zhixinxxx.com/dledu/api/web/v1/courses/name?name=hadoop) 我配置了 location /dledu/api
在這個location中 通過 access_by_lua_file ngx.location.capture 到一個權限驗證的 location去 (假設為 location /auth) 當回傳結果值判斷為正常時 再轉向到之前的http://www.zhixinxxx.com/dledu/api/web/v1/courses/name?name=hadoop 請求
相當于在lua中做了攔截器的動作
但是當我 做第二次 ngx.location.capture("/api_proxy") 的時候 就報了404
upstream web_server {
server 127.0.0.1:8099
}
location /api_proxy { proxy_pass http://web_server; }
剛接觸nginx希望各位大大指點迷津,謝謝
分可以追加
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/134128.html
標籤:網絡協議與配置
上一篇:Python 新人
