呼叫007 2021-09-03 11:29 采纳率: 63.2%
浏览 27
已结题

centos已经有一运行中网站域名,现在新增加一网站,想通过这个域名/backhome的方式把这个网站加上

服务器环境是lnmp;现在这个服务器上已经有一网站www.example.cc,现在我想新增一网站,用www.example.cc/backhome的方式打开这个网站,但是这个网站是tp5开发的,我应该怎么放上去,在nginx的conf里面怎么设置呢?

conf里面内容

server
{
    listen 80;
    server_name www.example.cc;
    index index.html index.htm index.php;
    root  /data/wwwroot/www.example.cc;
    error_log /var/log/nginx/www.example.cc-error.log crit;
    access_log  /var/log/nginx/www.example.cc-access.log;
    include extra/*.conf;
    include conf.d/rewrite/thinkphp.conf;

#------------- SSL Start --------------


#------------- SSL End  ---------------
    location /backhome
    {
         alias /data/wwwroot/backhome/public/;
         index index.php index.html;
         location ~ ^/backhome/.+\.php$ {
              alias /data/wwwroot/backhome/public/;
              fastcgi_pass  unix:/dev/shm/php-fpm-default.sock;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME /data/wwwroot/backhome/$fastcgi_script_name;
              include        fastcgi_params;
         }
         include conf.d/extra/*.conf;
    }
}

  • 写回答

1条回答 默认 最新

  • variation8 2021-09-03 13:42
    关注

    server
    {
    listen 80;
    server_name http://www.example.cc/backhome ;
    index index.html index.htm index.php;
    root /data/wwwroot/ The domain name Example.cc is for sale The domain name Example.cc is for sale. Make an offer or buy it now at a set price. http://www.example.cc/ ;
    error_log /var/log/nginx/www.example.cc-error.log crit;
    access_log /var/log/nginx/www.example.cc-access.log;
    include extra/*.conf;
    include conf.d/rewrite/thinkphp.conf;

    #------------- SSL Start --------------

    #------------- SSL End ---------------
    location /backhome
    {
    alias /data/wwwroot/backhome/public/;
    index index.php index.html;
    location ~ ^/backhome/.+.php$ {
    alias /data/wwwroot/backhome/public/;
    fastcgi_pass unix:/dev/shm/php-fpm-default.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /data/wwwroot/backhome/$fastcgi_script_name;
    include fastcgi_params;
    }
    include conf.d/extra/*.conf;
    }
    }
    在配置文件中加一个server

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 11月11日
  • 已采纳回答 11月3日
  • 创建了问题 9月3日

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c