小编Lu3*_*u32的帖子

为Laravel配置nginx在子文件夹中

我有旧项目,现在需要新的功能,我将使用laravel提供它,一切正常在xampp与apache工作,但我的服务器con nginx显示我访问被拒绝的消息,无法访问我的路线,我应该如何如果在mysite.com/2015中安装了laravel,我的网站配置如下,我改变了什么showld?我试过了

location /newsection/ { 
   try_files $uri $uri/ /newsection/public/index.php$request_uri;
}
Run Code Online (Sandbox Code Playgroud)

但它会导致500错误

server {
    listen 80;
    server_name am2.aminversiones.com;
    root /home/forge/am2.aminversiones.com;

    # FORGE SSL (DO NOT REMOVE!)
    # ssl_certificate;
    # ssl_certificate_key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    index index.html index.htm index.php;

    charset utf-8;

    client_max_body_size 300M;

    location / {
        #try_files $uri $uri/ /index.php?$query_string;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/am2.aminversiones.com-error.log error;

    error_page 404 /index.php;

    location …
Run Code Online (Sandbox Code Playgroud)

php nginx laravel

13
推荐指数
3
解决办法
1万
查看次数

标签 统计

laravel ×1

nginx ×1

php ×1