nginx – Setup SSL on Public URL and Admin Dashboard of an app running on port 9000


I seem to have a problem configuring SSL on an app on a subdomain, only that I don’t know how to fix them:

  1. I have a web app running on http://mysub.domain.com:9000
  2. This url is the admin dashboard of the app
  3. This app shoots email with public facing URLs like http://mysub.domain.com:9000/xxx/xxx/xxx (which lead to an action within my app)
  4. The mysub.domain.com is SSL enabled and loads with SSL but the moment the port (9000) is added it returns error page and I only have access to it via http
  5. The problem : 1 – port is visible to public and 2 – the URL shows insecure (when clicked by users it opens with port)
  6. The solution required : 1 – port to be removed without the action of the URL to be impacted and the same URL needs to be served on SSL

I have linux 18/postgres 12 and apache (webserver) + nginx (reverse proxy) running on my server.

Any help is appreciated. Pls also help with the name of the file to be edited.