Nginx error 502

AI-generated summary

The discussion revolves around resolving a Nginx error 502 issue. Pro_Dev initially seeks help after following a guide for running multiple websites on the same machine as Discourse. Falco cautions that the guide is for advanced admins and suggests sticking to the official guide if unfamiliar with Nginx and web hosting.

Pro_Dev clarifies that they have some experience with Nginx but are unsure about its error messages. michaeld explains that a 502 error typically means the Discourse instance is not running.

After investigation, Pro_Dev finds that the nginx.http.sock file is not being created. Further investigation reveals an error message related to the discourse.conf file, which is not found in the /etc/nginx/conf.d/ directory. Serakoi seeks input from Falco on resolving the issue.

Hi,

Second question of the day. I feel very dumb xD
Well then, I get 502 Bad gateway. I don’t know nginx that well.
I have followed This guide

Cheers!

As that guide says

If you aren’t familiar with nginx, docker and web hosting in general, please stay on the official guide.

Well i do know a bit of nginx, and I use it regularly. But I don’t know the errors of nginx well. I don’t really see any obvious errors.

502 means your Discourse instance is not starting / started / running.

Hi, After some investigation i found the nginx.http.sock file never gets created

Not when rebuilding, or whatever.

How can i fix this?

With kind regards,
ProDev

After even more investigation i now found the issues (I think) now I get this:

Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/nginx/conf.d/discourse.conf
Location of failure: /pups/lib/pups/replace_command.rb:8:in `read'
replace failed with the params {"filename"=>"/etc/nginx/conf.d/discourse.conf", "from"=>"/listen 80;/", "to"=>"listen unix:/shared/nginx.http.sock;\nset_real_ip_from unix:;\n"}
29a62052d71af43fee746d9257942f63ef14ff9262465631dee891769

Any ideas @Falco ? Because we really do not know.