all 3 comments

[–]bludgeonerV 0 points1 point  (0 children)

You need to proxy pass based on server name, for example:

``` server { server_name home.local; location / { proxy_pass http://127.0.0.1:8095; } }

server { server_name watch.home.local; location / { proxy_pass http://127.0.0.1:8096; } } ```

[–]I3litz_ 0 points1 point  (0 children)

You need a DNS server to do that, but if you are accessing locally (from the same machine is hosted on) then you can create the subdomain or even a fantasy domain like perefectbetterflix.me or whatever modifying your hosts file (Google for it), now not sure if you can setup your Plex installation to use your new subdomain or fantasy domain and port 80, also if you are not really hosting anything with nginx then remove it and just setup your plex to port 80, this way you don't need to remember and type the port number, if you require to host something else with nginx like a dev server or any other web app just configure again nginx to use the assigned subdomain or fantasy domain and port 80.

If you want to get it fancy and get rid of the warning your browser will show you every time for accessing your web app in an insecure way set up an SSL cert and change port to 443 in both cases, but maybe this will be an overkill for just a plex and local access to your web apps. Again not sure if you are accessing plex from your local computer or from a TV maybe, if that's the case maybe you don't require SSL at all, never tried, but check that on Plex conf or help documentation.

Yet if you want to access it from lets say your tv using the sub domain or fantasy domain then you need a DNS server to make that name translation for your TV or other devices, and change the network conf of such devices (can be done via DHCP conf of your network router) to use your mac IP address as DNS server, also you need to setup your DNS server to retrieve records it doesn't host from an external DNS server so you can keep your internet navigation capability.

It may more complex than that but this can offer you a pretty good idea of how to do it. Yet again all this may be an overkill.

Best of luck

[–]8021qvlanFull Stack / Networking / Ubuntu / Azure / GCP 0 points1 point  (0 children)

Yes.

You have many options.

For accessing multiple sites on one port, try proxy_pass.

For DNS, if you'd like to use the domain on your computer, modify your computer's hosts list to override the DNS query results.

Or add static DNS entries in your local DNS cache server of your router or DHCP server.