From 203880787356691f7621a3bd42a85292ba3c798e Mon Sep 17 00:00:00 2001 From: redxef Date: Mon, 7 Mar 2022 17:58:42 +0100 Subject: [PATCH] Add example. --- example/cert/fullchain.pem | 15 +++++++++++++++ example/cert/privkey.pem | 16 ++++++++++++++++ example/envsubst.conf | 1 + example/nginx.conf | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 example/cert/fullchain.pem create mode 100644 example/cert/privkey.pem create mode 100644 example/envsubst.conf create mode 100644 example/nginx.conf diff --git a/example/cert/fullchain.pem b/example/cert/fullchain.pem new file mode 100644 index 0000000..65b5198 --- /dev/null +++ b/example/cert/fullchain.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICZjCCAc+gAwIBAgIUNBIfi45A6ftwAE4mg5Cp8Fz5vxMwDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjAzMDcxNjM2MzlaFw0yMzAz +MDcxNjM2MzlaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwgZ8wDQYJKoZIhvcNAQEB +BQADgY0AMIGJAoGBAL3/NNqCstBwRzGuLqETkoeLxaNctMH/4YmYnI931sSgeSN3 +QF/wB4gEIhNRkkZ7/D8uXXDr2wkqIeiGS3cEVlZ6fSZTFfA2oFgsMHdbA8y7hLMi +cnv7xBW3iRP2DCcTHzJk4I71wpx8YE1cGuri0B1mMpePZivWVQoRaAmK7gv/AgMB +AAGjUzBRMB0GA1UdDgQWBBSmhf4DJ3Q5/3fgMZEKEFG9tZOaoTAfBgNVHSMEGDAW +gBSmhf4DJ3Q5/3fgMZEKEFG9tZOaoTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4GBAFW44sMu4MdUv5pJCWiixgbm3pX3mV6iq+zXjswZLZocFR55si6q +2jcOLM65RVnd3VqT8KVeKpN+zWN1qsLYBtbEFXvoy5XvdmfLZj0gfbOshA7ti4JE +8p8pT/IXBRxIaNoGoLV/fFsv88kYQaWX3O+zlKCE+5ESKy1ZTWXSUw+d +-----END CERTIFICATE----- diff --git a/example/cert/privkey.pem b/example/cert/privkey.pem new file mode 100644 index 0000000..b1971aa --- /dev/null +++ b/example/cert/privkey.pem @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAL3/NNqCstBwRzGu +LqETkoeLxaNctMH/4YmYnI931sSgeSN3QF/wB4gEIhNRkkZ7/D8uXXDr2wkqIeiG +S3cEVlZ6fSZTFfA2oFgsMHdbA8y7hLMicnv7xBW3iRP2DCcTHzJk4I71wpx8YE1c +Guri0B1mMpePZivWVQoRaAmK7gv/AgMBAAECgYBHP2yShHCJuZD5EFhsDurj6YYz +vJAML+hjsNcE9euT0Jmcsxtw3pH0b5hXpj80L0poZvqjXc7FoQcWK0YhW38ESX3F +P4c7v3qxhSEVkzZ26Sl4TLaiH3/G/U9Qas7d/ELyTY/BD9piMm1xzJ/JkzCHiXEh +fLGgIH8vWXOMeUUAAQJBAN/TTv2EchHyIxjRK/+bC+JLTK6zG6zSvV4P+6c8+0G5 +eZ7zSiQleJobLUBcgGbFcvI7qArSnX1ShWcQk0eEDtcCQQDZTwVcxYq9cl0T2Fl6 +nfsvjbfjQji+lvG2kvOz0RReYzyZ58h9U/PAG2orj4SexQ3ZX9JfteworwUTT7vL +5g8ZAkEAiK9sb5lwZ9Es6bzjV6cBrOI7I/yxC+tuRYERN2IgNlTkFtOQFV7ktYef +LMzQhPJTbeZMir9v+dZpLTWMG4Jj5QJBALsCPPwkaAw2shEU+5QBBpxa2mgxogGq +hqL2/dC+WkgMIKfWBvyL1dV6AjkwjhHQROXPh4ykU3KDg9uln1iOSGkCQD6IRyNG +0atR16yjI/xPKdQbz+tkQHs3p5dtNADpi0t0oEucUJ2dnyWCRvKpLtH4kR/LqGAl +v0bg3PKUmWCYrj4= +-----END PRIVATE KEY----- diff --git a/example/envsubst.conf b/example/envsubst.conf new file mode 100644 index 0000000..0ec23cc --- /dev/null +++ b/example/envsubst.conf @@ -0,0 +1 @@ +${DOMAIN_NAME} diff --git a/example/nginx.conf b/example/nginx.conf new file mode 100644 index 0000000..1dff13d --- /dev/null +++ b/example/nginx.conf @@ -0,0 +1,36 @@ +user nginx; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules/*.conf; + +events { + worker_connections 768; + multi_accept on; +} + +http { + server_tokens off; + include mime.types; + charset utf-8; + + access_log /dev/stdout; + error_log /dev/stdout; + + server { + server_name ${DOMAIN_NAME}; + listen 443 ssl; + + location / { + return 200 ''; + } + + ssl_certificate /cert/fullchain.pem; + ssl_certificate_key /cert/privkey.pem; + } + + server { + server_name ${DOMAIN_NAME}; + listen 80; + return 302 https://${DOMAIN_NAME}; + } +}