最近用flask写了一个接口,在配置nginx转发的时候遇到了点小问题,nginx配置如下
server { listen 80; server_name xxx.xxx.xxx; location /upload_api { rewrite ^/upload_api/(.+)$ /$1 break; proxy_pass http://127.0.0.1:8082; } }
flask收到的请求路径确实
127.0.0.1 - - [21/Oct/2016 16:31:36] "GET /upload_api HTTP/1.0" 404 -
我怎么能让用户请求/upload_api的时候flask收到的请求路径为/呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...