微信小程序后台服务器环境配置问题

问题遇到的现象和发生背景

你好,我们小程序后台服务器部署遇到问题,主要是https的域名指向问题

问题相关代码,请勿粘贴截图

server {
listen 81;
server_name localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    root  /usr/local/nginx/html/dist;

    location ~/group([0-9])/M00 {
        ngx_fastdfs_module;
    }


    location / {
        index  index.html;
        try_files $uri $uri/ @router;
    }
    
    
    location /prod-api/ {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header REMOTE-HOST $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.43.33.68:8081/;
        }
   
    location @router {
      rewrite ^.*$ /index.html last;
    }

HTTPS server

#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}
运行结果及报错内容

http://ip:端口访问正常,域名访问不行

我的解答思路和尝试过的方法

目前定位在nginx配置问题:如上面的conf代码,

我想要达到的结果

1、小程序访问的后台管理系统前端用的是81端口;
2、小程序访问的后台管理系统后端用的是8081端口。
问:一个域名如何配置分别访问两个端口,nginx如何配置,是否需要vhost配置,如何配置?请不吝赐教。

你多写个listen,server_name写你的域名不就完了