为图方便,虚拟机上直接安装了LNMP
lnmp vhost add blog.gisfly.xyz
新增之后,想修改一些配置项,则需要找到相关路径,以blog.gisfly.xyz
为例
- 增加 ssl 证书
这时需要修改 nginx config
nginx config :/usr/local/nginx/conf/
完整路径:/usr/local/nginx/conf/vhost/blog.gisfly.xyz.conf
以下是整个配置项
server
{
listen 80;
#listen [::]:80;
server_name blog.gisfly.xyz ;
if ($scheme = http ) {
return 301 https://$host$request_uri; }
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/blog.gisfly.xyz;
include rewrite/other.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;
listen 443 ssl;
ssl_certificate /usr/local/nginx/conf/cert/2878637_blog.gisfly.xyz.pem;
ssl_certificate_key /usr/local/nginx/conf/cert/2878637_blog.gisfly.xyz.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/blog.gisfly.xyz.log;
}
- 网站文件打包后存放的地方
新建一个server之后,文件部署应该放在哪呢
其实conf 文件里面已经有设置
root /home/wwwroot/blog.gisfly.xyz;
这个就是部署的路径