-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnginx-ssl.sh
More file actions
29 lines (23 loc) · 1.65 KB
/
nginx-ssl.sh
File metadata and controls
29 lines (23 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
#----------------------------------------------------------------------------------
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
#----------------------------------------------------------------------------------
# Website: https://EngineScript.com
# GitHub: https://github.com/Enginescript/EngineScript
# License: GPL v3.0
#----------------------------------------------------------------------------------
# EngineScript Variables
source /usr/local/bin/enginescript/enginescript-variables.txt || { echo "Error: Failed to source /usr/local/bin/enginescript/enginescript-variables.txt" >&2; exit 1; }
source /home/EngineScript/enginescript-install-options.txt || { echo "Error: Failed to source /home/EngineScript/enginescript-install-options.txt" >&2; exit 1; }
# Source shared functions library
source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.sh || { echo "Error: Failed to source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.sh" >&2; exit 1; }
#----------------------------------------------------------------------------------
# Start Main Script
# Generate self-signed SSL certificate for localhost.
# This allows you to connect to your server's IP address with SSL enabled.
# Ignore browser errors related to certificate validity.
# Create Self-Signed SSL Certificate
openssl req -new -newkey rsa:4096 -sha256 -days 36500 -nodes -x509 \
-keyout /etc/nginx/ssl/localhost/localhost.key -out /etc/nginx/ssl/localhost/localhost.crt \
-subj "/C=US/ST=Florida/L=Orlando/O=EngineScript/CN=localhost" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"