路由規(guī)則不生效
? location / {
??? try_files $uri $uri/ /index.php?$query_string;
? }
已經(jīng)在站點(diǎn)中配置了如下
server {
? listen 80;
? server_name 106.14.205.72;
? access_log /data/wwwlogs/106.14.205.72_nginx.log combined;
? index index.html index.htm index.php;
? root /data/wwwroot/fange;
?
? location / {
??? try_files $uri $uri/ /index.php?$query_string;
? }
? #include /usr/local/nginx/conf/rewrite/laravel.conf;
? #error_page 404 /404.html;
? #error_page 502 /502.html;
?
? location ~ [^/]\.php(/|$) {
??? #fastcgi_pass remote_php_ip:9000;
??? fastcgi_pass unix:/dev/shm/php-cgi.sock;
??? fastcgi_index index.php;
??? include fastcgi.conf;
? }
? location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
??? expires 30d;
??? access_log off;
? }
? location ~ .*\.(js|css)?$ {
??? expires 7d;
??? access_log off;
? }
? location ~ /\.ht {
??? deny all;
? }
}但訪問過程除了/外的路由必須帶index.php
http://106.14.205.72/blog2/public/basic1? 結(jié)果File not found.
http://106.14.205.72/blog2/public/? 這個(gè)能訪問出現(xiàn)laravel的welcom視圖
Route::get('/', function () {
????return view('welcome');
});
Route::get('basic1',function(){
? ? return 'hello world2';
});
2017-11-04
路由代碼沒問題,應(yīng)該是其他問題,不太清楚