Having issues in running Bokeh server on https

We are using Bokeh server to create a dashboard. It work fine on http but when on https it is not loading saying a bad gateway. We added the path to the cert as shown in the code below. Bokeh version is 2.4.3
def bk_worker():
# Can’t pass num_procs > 1 in this configuration. If you need to run multiple
# processes, see e.g. flask_gunicorn_embed.py
BOKEH_SSL_CERTFILE =r"D:\path\tothecert.pem"
server = Server({‘/bkapp’: bkapp}, io_loop=IOLoop(), allow_websocket_origin=[“*”], port=BOKEH_SERVER_PORT, debug=True, autoreload=True, serve_traceback=True, ssl_certfile=BOKEH_SSL_CERTFILE )
except Exception as e:
return f"Error starting Bokeh server: {e}"

@Ajila please edit your post to use proper code formatting.

There is not nearly enough information here to speculate. When reporting errors, always include the full error, i.e. complete, entire stack traces or error messages. Also be clear about where exactly the error is showing up, what exact proces, etc. Bokeh itself never returns a 502, so this must be coming from a reverse proxy or load balancer or something else in front of the Bokeh server. In this case, the 502 is a secondary issue. You’ll probably need to look into the logs for whatever that other process is to find the actual proximate error, although the Bokeh process may also have valuable information in logs.

Hi Bryan, I have included the code in formatted way . furthermore, I cant get any more logs related to this.Trying to get the logs

The code above is still unformatted. FYI to apply code formatting, either use the < / > icon on the editing toolbar, or put triple backtick ``` fences around the code blocks.

Hopefully you can locate additional logs, as there is not really anything that can be added without them.