Nginx配置Thinkphp

  • 2019 年 12 月 11 日
  • 筆記

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;      }    }