Setup SSL on ztidev.com

How to setup SSL using NGINX, Certbot on our ZTI server.

First, you have to learn how to remote to zti server

Second, you have to know about basic Linux command line.

Third, your URL ex. http://ztidev.com:8081/demo-api or http://ztidev.com:81/web

1. Config NGINX Configuration file.

Remote to ZTI Dev. server and edit NGINX config file with command:

vi /etc/nginx/conf.d/<domain_name>.conf

ex. demo_ztidev_com.conf

1.1. Config server {} tag by type insert command:

i

1.1.1 With sub domain, add new server{} tag.

server {
        server_name <sub_domain>.ztidev.com;
        client_max_body_size 1024M;

        location / {
                proxy_pass http://localhost:<port>/;
        }
}

sub_domain: your target subdomain name -> Ask P’Pae, P’Korn to config subdomain in GoDaddy.
path: context path
ztidev_port: port in ztidev.com
ztidev_path: part in ztidev.com

1.1.2 Without sub domain, add new location / {}

server {
        server_name ztidev.com; # managed by Certbot

        include /etc/nginx/default.d/*.conf;
        client_max_body_size 128M;

        location / {
                proxy_pass http://localhost:3004;
                proxy_set_header                Host $host;
                proxy_pass_request_headers      on;
        }

        location /xxx {
                proxy_pass http://localhost:8080/xxx;
        }

        location /<path> {
                proxy_pass http://localhost:<port>/<ztidev_path>;
        }
...

1.2 To Exit Vim type by pressing ‘ESC’ then type :wq

1.3 Test NGINX config with command:

nginx -t

1.4 If everything success, restart NGINX with command:

systemctl restart nginx

2. Request HTTPS with command

certbot --nginx -d <subdomain>.ztidev.com

Test HTTPS with: https://<subdomain>ztidev.com