User dje4321 is trying to set up an offline page for their forum using a guide from Meta Discourse. They are experiencing two issues: Nginx is not redirecting 502 errors to the offline page, and when both Discourse and Nginx are running, they cannot reach the forums.
After debugging, fefrei suggests checking the Nginx configuration and logs. dje4321 provides the logs, which show a permission denied error when connecting to the upstream socket. fefrei suspects an issue with the socket, but dje4321 confirms the socket exists and has the correct permissions.
notriddle suggests checking if SELinux or AppArmor is enabled on the host system, and dje4321 confirms that SELinux is enabled. notriddle advises turning it off, which solves the issue.
The remaining issue is that Nginx is not redirecting 502 errors to the offline page. fefrei suggests adding a missing configuration block, but dje4321 reports that it does not work. fefrei notes that the error_page directive is incorrect and suggests checking the Nginx log files. dje4321 discovers that SELinux is still causing issues and thanks the users for their help.
So im following this guide to setup a offline page for when the forum goes down for whatever reason but ive run into 2 issues. The two issues im running into are that nginx is not redirecting 502 errors to the offline page and when both discourse and nginx are running i cant reach the forums.
Weird! Are you 100% sure you’re talking to the right Nginx, and it is indeed reading the configuration you provide? When in doubt, I tend to replace everything in location / with something like return 410; (or some other unusual status code), checking whether I’m really served that status code.
Hm, too bad, that’s always a nice and easy explanation
Next, I’d try to debug this:
What happens if you try to access Discourse? What do the outer Nginx’s log files tell you about the request? Does anything show up in the log files withing Discourse’s container?