魔众短剧系统如何将系统安装到子目录

魔众短剧系统 / 文档中心
文档中心
开发教程
安装常见问题

系统默认安装到根目录,如果需要安装到子目录,可以通过以下方式实现。

系统只推荐安装到根目录,安装到子目录可能会导致部分功能异常,需要自行测试,这里只提供一个实现方式。
所有的链接生成都是基于根目录的,如果安装到子目录,需要自行修改链接生成的逻辑。

第①步,增加配置文件,修改 .env 文件

# 系统子目录外部访问地址
SUBDIR_URL=https://example.com/subdir
# 系统子目录名称
SUBDIR=subdir

第②步,修改 Nginx 配置,设置子目录反向代理

Nginx 参考配置

server {
    listen 80;
    server_name example.com;
    location /subdir {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
    }
}

Apache 参考配置

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /path/to/your/subdir
    <Directory /path/to/your/subdir>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
QQ
微信
公众号