나는 nginx + uwsgi + 플라스크를 구성했으며 이제 플라스크에 정의 된 경로의 경로를 선행하는 데 어려움을 겪고 있습니다. 기본적인 질문은 : 가능한가?플라스크 및 nginx 루팅
내가 app.route('/login')
경로를 가지고 있고 /api/login
처럼이 경로에 액세스하도록 nginx를 구성하고 싶다고 가정 해 봅시다.
내 현재의 구성은 다음과 같습니다하지만 어떤 도움
location = /api { rewrite^/api/; }
location /api { try_files $uri @api; }
location @api {
include uwsgi_params;
uwsgi_pass uwsgicluster;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
감사를 작동하지 않습니다.
왜 앱에 경로 논리를 유지하지 않으시겠습니까? app.route ('/ api/login') – chishaku