Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于laradock 配置多个站点 #169

Open
zhiliangxie opened this issue Jun 18, 2021 · 0 comments
Open

关于laradock 配置多个站点 #169

zhiliangxie opened this issue Jun 18, 2021 · 0 comments

Comments

@zhiliangxie
Copy link

请问一下,我使用laradock在nginx里面使用域名直接配置后端没有任何问题,当我想要在子目录配置多个站点的时候,在进入站点只会显示页面title,没有任何内容。
我想要达到的效果是:
-page.com 首页
-page.com/dsshop1/api 后端1
-page.com/dsshop2/api 后端2

这个是我的nginx 设置

server {

    listen 80;
    listen [::]:80;

    server_name page.com;
    root /var/www/page/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    location /dsshop1 {
        alias /var/www/apps/dsshop1/api/public;
        try_files $uri $uri/ @app;

        location ~ \.php$ {
            try_files $uri /index.php =404;
            fastcgi_pass php-upstream;
            #fixes timeouts
            fastcgi_read_timeout 600;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $request_filename;
        }

    }
}

把任何dsshop换成官方laravel项目都没有任何若问题
以下是打开的效果。
2021_06_18_16_14_21_server tlp_root_192 236 193 133_22_Bitvise_xterm_root_080cf3fa6ca9_var_w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant