Hi,
I am coming from youtube video https://www.youtube.com/watch?v=obRxID54H14&list=PLEw57Zr9GItiqmK7RJgqvAr5593HGmu7Q&index=2&t=219s about fixing 502 Bad Gateway Nginx.
I have a Postal SMTP server installed on Ubuntu 18. For a reason I dont know, the server drops and shows 502 bad gatways nginx.
I have followed your debug on youtube and I found this proxy pass message. A backend service that is running on port 5000.
}
location @puma {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://127.0.0.1:5000;
}
I was not able to discover what service it was.
By chance I tried to start postal service by:
Sudo postal Start
The server returned
Started Procodile supervisor with PID 1227
I tried to access the server from the browser after and it worked!. However, I am not able to send emails event though I am 100% sure of the credentials.
My next step was to debug the SMTP service. and Here are the test returns:
Connected to smtp://postal.mylinkys.xyz:25/?starttls=when-available
<< 220 postal.mylinkys.xyz ESMTP Postal/LRL1GT
>> EHLO [172.31.10.74]
<< 250-My capabilities are
<< 250 AUTH CRAM-MD5 PLAIN LOGIN
>> AUTH CRAM-MD5
<< 334 PDA0Zjg0MWMzZDIxMGRhM2RjMGEzQHBvc3RhbC5teWxpbmt5cy54eXo
>> ZS5jb29rbGVyLmNvbSA2MWUyYjJhNzU1Mzc5NjJhMjRmMzI2MTVmYTI4MmE4Zg==
<< 535 Denied
>> AUTH PLAIN AGUuY29va2xlci5jb20AU3RDSlU5MjBhNTRjZkF1a09OOVZPTFNP
<< 235 Granted for mailing-system/smtp
>> MAIL FROM:<care@XXXXXXX.com>
<< 250 OK
>> RCPT TO:<mr.XXXXXX@gmail.com>
<< 250 OK
>> DATA
<< 354 Go ahead
>> From: care@XXXXX.com
>> Date: Tue, 29 Dec 2020 10:08:41 퍍
>> Subject: SMTP test from postal.mylinkys.xyz
>> Message-Id: <ZY1RYKPKKCU4.DT6UMYJYPLES3@WIN-AUIR3RRGP88>
>> To: mr.XXXXX@gmail.com
>> MIME-Version: 1.0
>> Content-Type: multipart/alternative; boundary="=-YDkWWl67JIrkb99tqr5XXA=="
>>
>> --=-YDkWWl67JIrkb99tqr5XXA==
>> Content-Type: text/plain; charset=utf-8
>>
>> Test message
>> --=-YDkWWl67JIrkb99tqr5XXA==
>> Content-Type: text/html; charset=utf-8
>> Content-Id: <ZY1RYKPKKCU4.4BNJ84W1Q29U2@WIN-AUIR3RRGP88>
>>
>> <b>Test message</b>
>> --=-YDkWWl67JIrkb99tqr5XXA==--
>> .
ERROR: The SMTP server has unexpectedly disconnected.
I was not able to send a message. So I tried to restart the whole server.
After the server restart I got again the 502 Bad Gateway Nginx error. I fixed it again using the command above and posted here asking for help.
Any ideas on what to do ?
Thank you very much
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @amer001,
It sounds like that the Postal service is crashing for some reason causing the 502 Nginx error.
What I could suggest is checking the logs for that service to see if you could get some more information on why it’s crashing.
According to this FAQs section on GitHub here:
https://github.com/postalhq/postal/wiki/FAQs
The logs should be located at:
/opt/postal/app/log
It could be crashing due to various reasons, for example, the server running out of RAM and killing the process.
Feel free to share the errors from the logs here as well. Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.