Home > Enterprise >  Serve HTTPS traffic on NGINX servers
Serve HTTPS traffic on NGINX servers

Time:08-30

I'm trying to configure an Ansible NGINX deploy job to enable HTTPS on NGINX servers.

I can see that nginx.conf.je has http{...}. Do I need something similar for HTTPS or how is this configured?

CodePudding user response:

You have to configure it as follows on nginx.conf file -

events {}

http {

    server {
        listen 443 ssl;
        server_name www.example.com;
        ssl_certificate www.exaple.com.crt;
        ssl_certificate_key www.example.com.key;
        location / {
            return 200 "Nginx is running";
        }
    }
}

Found this at nginx.org/en/docs/http/configuring_https_servers.html.

  • Related