美文网首页
centos7.4——6.nginx配置文件

centos7.4——6.nginx配置文件

作者: AnubisAwooo | 来源:发表于2018-04-05 17:16 被阅读0次

centos7.4——nginx配置文件

#配置文件放这里
mkdir -p /mine/data/nginx/conf/etc
ln -s /mine/data/nginx/conf/etc /usr/local/nginx/conf/etc
#修改原本配置文件,使其包含我们的配置文件
sed -i "s|#gzip  on;|#gzip  on;\n\n    include etc/start.config;\n    include etc/*.conf;\n    include etc/end.config;|g" /usr/local/nginx/conf/nginx.conf
#起始文件
echo "
server {
    listen 80;
    server_name _;
    return 404;
}" > /usr/local/nginx/conf/etc/start.config
#末尾文件
echo "
" > /usr/local/nginx/conf/etc/end.config

systemctl restart nginx

相关文章

网友评论

      本文标题:centos7.4——6.nginx配置文件

      本文链接:https://www.haomeiwen.com/subject/esrdhftx.html