nginx配置Laravel
来源:互联网 发布:java分层数据的储存 编辑:程序博客网 时间:2024/06/08 19:20
server { listen 80; server_name xxx.com; root "/项目目录/public"; index index.html index.htm index.php; # 无需用到 HTTPS 故注释 # listen 443 ssl http2; # ssl_certificate /etc/nginx/ssl/xxx.com.crt; # ssl_certificate_key /etc/nginx/ssl/xxx.com.key; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; # 日志,指定路径后可选开启。末尾值可选 error|notice|info # error_log /var/log/nginx/xxx.com-error.log error; sendfile off; client_max_body_size 100m; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # 如果用到 sock 则值参考 unix:/var/run/php/php7.0-fpm.sock fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; include fastcgi_params; } location ~ /\.ht { deny all; }}
第二份(目前自己在用的):
server { listen 80; server_name bcccopy.com ; root "D:/phpStudy/WWW/bcc_copy"; location / { index index.html index.htm index.php; #autoindex on; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; }}
第三份:
server { listen 80; server_name laravel.app; root /项目目录/public; 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; 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; include fastcgi_params; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { } location ~ /\.ht { deny all; }}
阅读全文
0 0
- Nginx Laravel alias配置
- Laravel的Nginx配置
- laravel nginx 配置
- laravel 在nginx配置
- laravel nginx配置
- laravel nginx配置
- Laravel配置nginx环境
- nginx配置laravel
- nginx 配置 laravel
- nginx 配置 laravel
- nginx配置Laravel
- Laravel配置nginx环境
- Nginx运行Laravel的配置
- Laravel 5.2配置Nginx服务器
- laravel 5.2 nginx 服务器配置
- 我的laravel nginx配置
- nginx的通用配置 和laravel 配置
- ubuntu_14.04.2安装配置laravel+nginx
- java线程继承Thread方法和实现Runable方法区别
- 2. Add Two Numbers
- Python进阶之“属性(property)”详解
- jquery获取和设置select选中的值/文本/索引及选中事件
- CSharp自定义文件的属性
- nginx配置Laravel
- Android设计模式之工厂模式 Factory
- 密码学
- Windows版OpenVPN安装、配置教程
- 成都链家数据爬取分析<初稿>
- scrum中的四个会议
- 解决BurpSuite不能抓本地包的问题
- HP pavilion 15-cc笔记本电脑安装ubuntu的一些折腾事儿
- web项目开发总结