From e882ada7bdd1db5cdd0aa0cdbcb1a12e9552892f Mon Sep 17 00:00:00 2001 From: knst-kotov Date: Wed, 10 Nov 2021 17:10:59 +0300 Subject: [PATCH] fix nginx.conf and oauth callback --- auth/oauth.py | 4 ++-- nginx.conf.sigil | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/auth/oauth.py b/auth/oauth.py index 87d427f2..531da59a 100644 --- a/auth/oauth.py +++ b/auth/oauth.py @@ -6,7 +6,7 @@ from urllib.parse import quote_plus from auth.authorize import Authorize from auth.identity import Identity -from settings import OAUTH_CLIENTS, OAUTH_CALLBACK_URL +from settings import OAUTH_CLIENTS, BACKEND_URL, OAUTH_CALLBACK_URL oauth = OAuth() @@ -66,7 +66,7 @@ async def oauth_login(request): provider = request.path_params['provider'] request.session['provider'] = provider client = oauth.create_client(provider) - redirect_uri = request.url_for('oauth_authorize') + redirect_uri = "%s/%s" % (BACKEND_URL, 'oauth_authorize') return await client.authorize_redirect(request, redirect_uri) async def oauth_authorize(request): diff --git a/nginx.conf.sigil b/nginx.conf.sigil index bff0869f..805ea6df 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -10,6 +10,8 @@ location /graphql { + rewrite ^/graphql/(.*) /$1 break; + gzip on; gzip_min_length 1100; gzip_buffers 4 32k; @@ -31,4 +33,4 @@ location /graphql { proxy_set_header X-Forwarded-Port {{ $.PROXY_X_FORWARDED_PORT }}; proxy_set_header X-Forwarded-Proto {{ $.PROXY_X_FORWARDED_PROTO }}; proxy_set_header X-Request-Start $msec; -} \ No newline at end of file +}