python-microservice-fastapi icon indicating copy to clipboard operation
python-microservice-fastapi copied to clipboard

Error:502 Bad Gateway nginx/1.19.4

Open HamidNew opened this issue 5 years ago • 1 comments

Thanks for the nice code. While running the following error occurs, any idea how to fix it? 502 Bad Gateway nginx/1.19.4

HamidNew avatar Nov 16 '20 20:11 HamidNew

add these lines in your nginx_config file server { listen 8080; server_name localhost; location /api/v1/movies { proxy_pass http://movie_service:8000/api/v1/movies; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; }

location /api/v1/casts { proxy_pass http://cast_service:8000/api/v1/casts; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; }

}

hossam20520 avatar Dec 19 '20 07:12 hossam20520