Check out example codes for "nginx listen on 80 and 443". It will help you in understanding the concepts better.

Code Example 1

server {
    listen 80;
    listen 443 default_server ssl;

    # other directives
}

Learn ReactJs, React Native from akashmittal.com