I am using NopCommerce 4.60.5 , with Ubuntu 23 , Nginx as Reverse proxy to upstream .net app. Site is up and running with some minor issues that im working on. however, issue starts when I have restart nopCommerce from admin when some changes to the setting happens and i get 502 Bad Gateway error. nginx error log shows , connection refused to upstream server. I have local server and production server , both have same exact issue. is been 7 days that i have search and tried almost everything out there to see i can fix this but nothing has worked. here is my configuration ..
server { # include snippets/snakeoil.conf; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name www.MYDOMAIN.ca MYDOMAIN.ca; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; proxy_pass http://localhost:5000; add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; #proxy_set_header X-Real-IP $remote_addr; proxy_cache_bypass $http_upgrade; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_set_header X-Forwarded-Proto $scheme; #proxy_set_header X-Frame-Options SAMEORIGIN; #proxy_set_header X-Forwarded-Host $host; #proxy_read_timeout 900; }
listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot server_name MYDOMAIN.ca www.MYDOMAIN.ca; ssl_certificate /etc/letsencrypt/live/supplysolution.ca/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/supplysolution.ca/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
} server { if ($host = www.MYDOMAIN.ca) { return 301 https://$host$request_uri; } # managed by Certbot
if ($host = MYDOMAIN.ca) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; listen [::]:80; server_name MYDOMAIN.ca www.MYDOMAIN.ca; return 404; # managed by Certbot } I would really appreciate if anyone can help me in fixing this issue that been having for past 7 days .