New Phoenix Developer: Installation Directory, UFW Firewall Rules, Run Nonstop

I’m still having problems here trying to get my website URL https://www.example.com/ex/ to display the default “Welcome To Phoenix” page. I made some slight changes and made some progress. First, I created a new project in my web user directory where I plan to use it indefinitely. In apache, I’ve edited the virtual host to:

<VirtualHost *:443>
  ServerName www.example.com
  ServerAlias example.com
  DocumentRoot /home/example/example.com

  <Location /ex/>
    ProxyPass http://127.0.0.1:4000/ex/
    ProxyPassReverse http://127.0.0.1:4000/ex/
  </Location>
</VirtualHost>

and left the router.ex the same:

 scope "/ex", ChatterWeb do
    pipe_through :browser

    get "/", PageController, :index
  end

So when I go to that URL (without the port 4000 part), the css, js and image files loaded up. However, in the logs, I still get this error:

[info] GET /ex/phoenix/live_reload/frame
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /ex/phoenix/live_reload/frame (ExchatWeb.Router)
    (exchat 0.1.0) lib/phoenix/router.ex:402: ExchatWeb.Router.call/2
    (exchat 0.1.0) lib/exchat_web/endpoint.ex:1: ExchatWeb.Endpoint.plug_builder_call/2
    (exchat 0.1.0) lib/plug/debugger.ex:136: ExchatWeb.Endpoint."call (overridable 3)"/2
    (exchat 0.1.0) lib/exchat_web/endpoint.ex:1: ExchatWeb.Endpoint.call/2
    (phoenix 1.5.10) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
    (cowboy 2.9.0) /home/example/exchat/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.9.0) /home/example/exchat/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
    (cowboy 2.9.0) /home/example/exchat/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
    (stdlib 3.15.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

When I click on the “Live Dashboard” link (https://example.com/ex/dashboard), I get the same type of error:

##### Phoenix.Router.NoRouteError <small>at GET</small> <small>/ex/dashboard</small>

# no route found for GET /ex/dashboard (ExchatWeb.Router)

Just trying to get the default phoenix page working on a production website URL so I can begin practicing… Right now, I’m just randomly adding/subtracting “/ex” to various snippets in the endpoints/router files, probably breaking stuff in the process, and there is no good guide on the internet on just doing this basic thing of getting example.com:4000 to fully work on example.com/[some-directory]/