一、下载源码(master)
GitHub - digitalocean/nginxconfig.io: ⚙️ NGINX config generator on steroids 💉
二、编译
npm install
npm run build
三、将编译后的dist目录下的文件拷贝到nginx托管服务器下的目录:/data/wwwroot/nginx.config.com
四、配置nginx托管文件 nginx.config.com.conf
server {
listen 80;
server_name nginx.config.com;
access_log off;
rewrite ^/(.*) https://nginx.config.com/$1 permanent;
}
server {
listen 443 ssl;
ssl_certificate /etc/nginx/cert/server.crt;
ssl_certificate_key /etc/nginx/cert/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
server_name nginx.config.com;
access_log logs/nginx.config.com.log main;
location / {
try_files $uri $uri/ /index.html;
root /data/wwwroot/nginx.config.com;
index index.html;
}
}
五、重新加载nginx 配置
cd /usr/local/nginx/sbin
./nginx -s reload
六、配置host
192.168.31.180 nginx.config.com