- 积分
- 21
- 威望
-
- 金钱
-
- 注册时间
- 2018-12-12
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2022-11-27 13:05:42
|
显示全部楼层
是这个吗?
安装过程:
Please enter domain(example: www.lnmp.org): www.abc.com
Your domain: www.abc.com
Enter more domain name(example: lnmp.org sub.lnmp.org):
domain list: www.abc.com
Please enter the directory for the domain: www.abc.com
Default directory: /home/wwwroot/www.abc.com:
Virtual Host Directory: /home/wwwroot/www.abc.com
Allow Rewrite rule? (y/n) n
You choose rewrite: none
Enable PHP Pathinfo? (y/n) n
Disable pathinfo.
Allow access log? (y/n) n
Disable access log.
Enable IPv6? (y/n) y
Enabled IPv6 Support in current Virtualhost.
Create database and MySQL user with same name (y/n) n
Add SSL Certificate (y/n) y
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
3: Use BuyPass to create SSL Certificate and Key
4: Use ZeroSSL to create SSL Certificate and Key
Enter 1, 2, 3 or 4: 1
Please enter full path to SSL Certificate file: /usr/local/nginx/conf/vhost/abc.com_bundle.crt
Please enter full path to SSL Certificate Key file: /usr/local/nginx/conf/vhost/abc.com.key
Using 301 to Redirect HTTP to HTTPS? (y/n) n
DO not setting 301 Redirect.
Press any key to start create virtul host...
dCreate Virtul Host directory......
set permissions of Virtual Host directory......
You select the exist rewrite rule:/usr/local/nginx/conf/rewrite/none.conf
Test Nginx configure file......
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
Reload service php-fpm done
Create dhparam.pem...
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
.........................................................................................+..........................................................................................+..................................................+..........................+...................................................................................+...............................................................................+.....................................................+....................................+.........................................................................................................................+.......................................................................................+.............................................................................................................................................................................................+...........................................................................................................+..........................+.................................................................................................................................+.............................................................................................................................................................................+....................................+..........................................+..................................................+............+................+........+...........................................................+...............................................................................+................................................................+..........................................+.......................................................................................................................................................................+..................................................................................................................................+................................................................................................................................................................................................................................................................................................................................................................................................................................+...........................................+......................+.........................................................................................................................................................................+...........................................................................................................................................................................................................................................................................................................+..++*++*
Test Nginx configure file......
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
================================================
Virtualhost infomation:
Your domain: www.abc.com
Home Directory: /home/wwwroot/www.abc.com
Rewrite: none
Enable log: no
Create database: no
Create ftp account: no
Enable SSL: yes
=>Certificate file
IPv6 Support: Enabled
================================================
[root@wang004 ~]#
域名配置:
server
{
listen 80;
listen [::]:80;
server_name www.abc.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.abc.com;
include rewrite/none.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
server
{
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.abc.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.abc.com;
ssl_certificate /usr/local/nginx/conf/vhost/abc.com_bundle.crt;
ssl_certificate_key /usr/local/nginx/conf/vhost/abc.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
ssl_session_cache builtin:1000 shared:SSL:10m;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
include rewrite/none.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
|
|