Docker Community Forums

Share and learn in the Docker community.

Nginx proxy_pass with magento container

Hello,
I had a setup Magento and Nginx on the RedHat server with docker and Nginx container is set up with SSL,
my plan to set up proxy_pass with Nginx for any other technology container but when I set it up it’s given me a 502 bad gateway error.
My configuration is below:-
nginx container:-

location /magento/ {
proxy_set_header Host $http_host;
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;
client_max_body_size 100M;
client_body_buffer_size 1m;
proxy_intercept_errors on;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 256 16k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_max_temp_file_size 0;
proxy_read_timeout 300;
proxy_pass http://192.168.1.203:6003/magento/;
access_log /var/log/nginx/magento/access.log;
error_log /var/log/nginx/magento/error.log;
}

URL is working:- https://sun.narola.online/
URL is not working:-https://sun.narola.online/magento/info.php

Help to solve this problem.
Thanks in advance.