Hi everyone,
I've been working on a Django project using Google's speech-to-text api. It works fine on my local as well as a standalone application. However, when I deploy it to the production that has nginx working with waitress, it doesn't work and gives Bad Gateway error and the nginx server stops running.
This is where it happens.
from google.cloud import speech_v1 .... .... client = speech_v1.SpeechClient()
Here is my nginx-waitress configuration:
#Finally, send all non-media requests to the Django server. location / { proxy_pass http://localhost:8080; #proxy_set_header Host $host; #proxy_set_header X-Forwarded-For $remote_addr; }
I tried with that $host and $remote_addr lines, still no luck.
Here is the credentials json file that is working fine in both local django server and standalone application.
{ "type": "service_account", "project_id": "my_project_id", "private_key_id": "my_private_key_id", "private_key": "my_private_key", "client_email": "my_client_email", "client_id": "my_client_id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/speechtoblog-service%40yt2blog-377413.iam.gserviceaccount.com" }
Is there any other configurations that I need to do in the nginx server side? Or anything else? I would highly appreciate your help.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |