worker_processes 4;
events{
worker_connections 1024;
}
http{
server {
listen 80;
server_name myserver;
location / {
proxy_pass http://mysite;
}
}
upstream mysite {
server 100.101.56.52:8012;
server 100.101.56.52:8013;
}
}上面是nginx的配置 public ActionResult CreateQrCode(string url)
{ var stream = QRCodeGenerate.BuildQrCode(url); return File(stream, "image/png"); //return Content(url);
}這個是我的C#代碼,在開發環境是OK的,但是用nginx做負載均衡的時候,就報502錯誤了。如果輸出文字,即被注釋的return Content(url);又是可以的,所以我判斷是我nginx配置有問題,但是又不知道怎么配,請大神指點。
nginx負載均衡,程序動態生成圖片報502錯誤
至尊寶的傳說
2018-07-12 14:18:44