Nginx配置Thinkphp

2019-12-11 12:22:34 浏览数 (1)

代码语言:javascript复制
server {
    listen 80;
    root /data/web/html/blog.phpfs.com;
    index index.php index.html index.htm;
    server_name blog.phpfs.com;
    access_log /data/logs/nginx/blog.phpfs.com-access.log main;
    error_log /data/logs/nginx/blog.phpfs.com-error.log;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    location ~* ^. .(jpg|jpeg|gif|css|png|js|ico)$ {
        #access_log off;
        expires 30d;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ .php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(. .php)(/. )$;
        fastcgi_pass unix:/dev/shm/php5.6-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

}

0 人点赞