How to reverse proxy the jitsi of the intranet?

Install jitsi on the intranet server, let the public server use nginx reverse proxy, and then use the domain name to access.
Self-signed domain name:
Hosts configuration:
Nginx reverse proxy configuration:

server {
listen 80;

return 301 https://$host$request_uri;


server {
listen 443 ssl;
client_max_body_size 100M;
charset UTF-8;
client_header_buffer_size 10k;
large_client_header_buffers 4 16k;

ssl_certificate /app/ssl/;
ssl_certificate_key /app/ssl/;

    location / {

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;


Because I have configured in the hosts file of my computer and the server of nginx

Why not configure hosts to achieve this effect?