laravel nginx 配置
时间:2016-05-10 09:59来源:linux.it.net.cn 作者:IT
server {
02.
03. listen 80;
04. server_name sub.domain.com;
05. set $root_path '/var/www/html/application_name/public';
06. root $root_path;
07.
08. index index.php index.html index.htm;
09.
10. try_files $uri $uri/ @rewrite;
11.
12. location @rewrite {
13. rewrite ^/(.*)$ /index.php?_url=/$1;
14. }
15.
16. location ~ \.php {
17.
18. fastcgi_pass 127.0.0.1:9000;
19. fastcgi_index /index.php;
20.
21. include /etc/nginx/fastcgi_params;
22.
23. fastcgi_split_path_info ^(.+\.php)(/.+)$;
24. fastcgi_param PATH_INFO $fastcgi_path_info;
25. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
26. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
27. }
28.
29. location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
30. root $root_path;
31. }
32.
33. location ~ /\.ht {
34. deny all;
35. }
36.
37.}
(责任编辑:IT) |
------分隔线----------------------------