Nginx 项目配置

Laravel5.3

server {
    listen 80;

    root /apps/aiyouAaa/public;
    index index.php index.html index.htm;

    server_name admin.aaa.com admin.aaa.cc; # 可以多个域名,配合 Docker 可实现开发环境 与 生产环境,无缝切换

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

CI

server {
    listen 80;

    root /apps/aiyouAaa;
    index index.php index.html index.htm;

    server_name f.aaa.cc;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

你可能感兴趣的:(Nginx 项目配置)