私はec2でリバースプロキシを設定して、nginxを使用してカスタムドメインを介してappengineアプリに安全にアクセスしようとしています。ページがユーザーサービスを必要とする場合を除いて、正常に動作しているようです。 Googleアカウントのログインにリダイレクトされた後、カスタムドメインの代わりにappspotドメインに移動します。私はappengineがテストでsslを持っていることを知っていますが、私は今使用できる解決策が欲しいです。これを克服することは可能ですか、自分のユーザーを作成する必要がありますか?AppEngineでSSLのリバースプロキシを使用する方法とUsersサービスを使用する方法
server {
listen 443;
server_name <custom-domain>;
keepalive_timeout 70;
ssl on;
ssl_certificate /etc/nginx/cert/server.crt;
ssl_certificate_key /etc/nginx/cert/server.key;
ssl_session_timeout 30m;
location/{
proxy_redirect off;
proxy_pass https://<appid>.appspot.com;
proxy_set_header Host <appid>.appspot.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_intercept_errors off;
}
}
マイドメインはEC2へのCNAMEのポインティングがあります
以下は、私の構成です。
===
回避策が見つかりました。それでももっと簡単なことを望んでおり、フィードバックを感謝します。続き
1) Client hits https: //mydomain.com/blah which goes through EC2 proxy https://appid.appspot.com/blah
2) The client is redirected to the google login page, with continue set as /aa?continue=/blah
3) Client logs into Google Accounts and is then redirected to https: //appid.appspot.com/aa?continue=/blah
4) Client hits https: //appid.appspot.com/aa which serves a redirect to https://mydomain.com/sc?c=ACSID&continue=/blah where ACSID is the Google account session cookie read by the handler for /aa.
5) Client hits https: //mydomain.com/sc?c=ACSID&continue=/blah which sets the ACSID session cookie for the domain mydomain.com and redirects to https: //mydomain.com/blah based on a continue parameter in aa passed to sc
が私の(いくつかのトリッキーなURLはエスケープと)ハンドラで制限された後のweb.xml
/ is publicly accessible
/aa is publicly accessible
/sc is publicly accessible
/* is restricted to logged in users
次のとおりです。この後
/ --> if not logged in, redirect to login page continue=/aa
/aa --> if not logged in, redirect to login page continue=/aa
/sc --> if not logged in, redirect to login page continue=/aa
/* --> if not logged in, redirect to login page continue=/aa?continue=*
、ユーザーサービスがいるようですSSLを使用しているプロキシ経由でも正常に動作します。 ACSID Cookieはmydomain.comにあり、プロキシを介してappengineに送信されます。
appspotドメインはまだ技術に詳しいユーザーには表示されますが、これは私の主な関心事ではありません。私の目標はhttpsを超えてサービスを提供し、私のカスタムドメインをURLバーに保持し、私のカスタムドメインを使用してSSLなしでサービスするユーザーデータをより安全にすることです。トランザクション全体がhttpsを超えているため、SSLを使用せずにmydomain.comを使用するよりもセッションCookieを公開するとは限りません。とにかくこのスキームがなくても、他のクロスサイト攻撃は機能します。
なぜmydomain.com/_ah/conflogin?state=blahが失敗し、この回避策が必要なのかまだ分かりません。