Welcome! Log In Create A New Profile

Advanced

nginx proxy_pass 502 bad gateway

Posted by samyvale171 
nginx proxy_pass 502 bad gateway
August 23, 2024 09:44AM
Hi to all, i am asking here cause to now this problem take me a lot of hours... i had decide to use nginx only as a load balancer cause have 4 machines (for now only one host websites but next year hope they came all fully working) that running Apache 2.4 server on Windows os... the load balancer in is state is fully working but the problem came out when i decide to take SSL certificate for 4 of my sites... HTTP to HTTPS reply in ok but then came out the 502 bad gateway error... after a lot of tryes and modify think everything i take https://www.youtube.com on my code and even in this way the error came out so i am nearly sured that nginx is my problem... i post later my nginx conf code... thanks for any help...

server {
listen 80;
server_name www.mysite.it;

return 301 https://www.youtube.it;
#return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name www.mysite.it;
ssl_certificate D:\cert\www.mysite.it\cert1.pem;
ssl_certificate_key D:\cert\www.mysite.it\privkey1.pem;

location / {
proxy_set_header Host $http_host;
proxy_pass https://"server local IP":6001;
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready