如何在ubuntu nginx上为客户端和后端设置SSL?

如何在ubuntu nginx上为客户端和后端设置SSL?,ubuntu,ssl,nginx,certbot,Ubuntu,Ssl,Nginx,Certbot,我正在按链接的指示进行操作 还有example.com-它可以工作,但我的后端设置在port example.com:8088上,现在不可用 现在,我的客户端配置如下所示: server { root /var/www/html/dist; # Add index.php to the list if you are using PHP index index.html; server_name hookahscope.com

我正在按链接的指示进行操作

还有example.com-它可以工作,但我的后端设置在port example.com:8088上,现在不可用

现在,我的客户端配置如下所示:

server {
        root  /var/www/html/dist;

        # Add index.php to the list if you are using PHP
        index index.html;

        server_name hookahscope.com www.hookahscope.com;

location ~ ^/(sitemap.xml) {
    root /var/www/html/public;
}
        location / {
                try_files $uri /index.html;
        }
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/hookahscope.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/hookahscope.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot





    ssl_trusted_certificate /etc/letsencrypt/live/hookahscope.com/chain.pem; # managed by Certbot
    ssl_stapling on; # managed by Certbot
    ssl_stapling_verify on; # managed by Certbot



}

server {
    if ($host = www.hookahscope.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = hookahscope.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80 default_server;
        listen [::]:80 default_server;

        server_name hookahscope.com www.hookahscope.com;
    return 404; # managed by Certbot
}
但我不明白我应该为后端配置更改什么:

server {
        listen 8082 default_server;
        listen [::]:8082 default_server;

        root /var/www/backend;

        # Add index.php to the list if you are using PHP
        index index.html;

        server_name _backend;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }


}
我的猜测之一是将后端从:8088更改为subdomain api.example.com