laravel怎么去掉路由的public
发布网友
发布时间:2024-10-03 22:33
我来回答
共1个回答
热心网友
时间:2024-11-20 23:41
直接把站点的跟路径配置到public目录就可以了啊
server {
listen 80;
server_name xxx.xxx.com;
root /代码目录/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .*\.(php|php5)?$ {
add_header Access-Control-Allow-Origin *;
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(gif|jpg|jpeg|png|ico|swf|flv)$ {
expires 30d;
}
}