Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:502 Bad Gateway nginx/1.19.4 #4

Open
HamidNew opened this issue Nov 16, 2020 · 1 comment
Open

Error:502 Bad Gateway nginx/1.19.4 #4

HamidNew opened this issue Nov 16, 2020 · 1 comment

Comments

@HamidNew
Copy link

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

@hossam20520
Copy link

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;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants