laravel nginx配置
2016-03-15 15:05
567 查看
1、新建配置文件:
2、重启nginx:
sudo vim /etc/nginx/conf.d/jjf.conf配置内容如下:
server { listen 80; server_name jjf.com; set $root_path '/var/www/jjf/public'; root $root_path; index index.php index.html index.htm; try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index /index.php; include /etc/nginx/fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root $root_path; } location ~ /\.ht { deny all; } }
2、重启nginx:
sudo nginx -t sudo nginx -s reolad
相关文章推荐
- NGINX服务器打开目录浏览功能
- Nginx代码解析
- Nginx的500,502,504错误解决方法
- nginx提示:500 Internal Server Error错误的解决方法
- centOS 编译安装nginx
- 解析nginx负载均衡
- nginx403问题
- Nginx 访问日志轮询切割
- nginx 优化
- 使用 Nginx 构建一个“高”可用的 PHP 集群
- Nginx详解-服务器集群()
- Nginx/LVS/HAProxy负载均衡软件的优缺点详解(转)
- 启动Nginx失败
- 遇到了nginx 在win2008 下启动不了的问题,记录一下解决的方法
- nginx报错打开文件数过多
- CentOS安装Nginx
- nginx 解决400 bad request 的方法
- mac安装nginx步骤
- Linux下安装Nginx详细图解教程
- nginx的zabbix自定义监控