分类
编程

nginx配置Laravel

前台html服务器,测试的时候不加缓存

server {
        listen  82;
        root   /usr/local/var/www;
        index index.html index.htm;
        location ~ .*\.(css|js|swf|htm|html)$ {
        add_header Cache-Control no-store;
        }
}

php项目:laravel和tp、CI都用这个

server {
        listen       83;
        root   D:\phpStudy\WWW\xxx\public; 
        index  index.html index.htm index.php;
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
}

更多参考:https://github.com/daylerees/laravel-website-configs