Running PeerTube on the same server as Mastodon - nginx config problem

Hi everyone, is it possible to run peertube on the same server as Mastodon?
Both instances will be small, so i’m not worried about performance, but I’m having trouble with nginx and the « upstream » directive. I assume it’s conflicting with the mastodon instance as the details are the same. I’m pretty new to nginx, so I have no idea of the significance.

the error is « nginx: [emerg] duplicate upstream « backend » in /etc/nginx/sites-enabled/peertube:18 » when i try and start nginx with both mastodon and peertube activated

Can I just rename everything in the nginx config file from « backend » to « backend2 » or « backendpt »?

Sure! You use the name you want: Module ngx_http_upstream_module

Thank you for you quick reply!
I renamed the upstream directive, and the proxy_pass lines, and it started.