Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ローカルホストでサービスを実行しています127.0.01:8000
127.0.01:8000
そして私はこれを使用してプロキシしています:
proxy_pass http://127.0.0.1:8000;
問題は、ユーザーのIPアドレスをサービスに渡す必要があることです。
何か案は?
カスタムヘッダーを設定して、実際のIPをdjangoに送信します。
proxy_set_header X-Real-IP $remote_addr;
これらのヘッダーは、request.META
request.META
http://wiki.nginx.org/HttpRealIpModuleを参照してください