Vagrant中Nginx对应Thinkphp3.2配置

server {
    listen 80;
    listen 443 ssl http2;
    server_name .ttlad.test;
    root "/home/vagrant/code/TTL/ttlad";

    index index.html index.htm index.php;

    charset utf-8;



    location / {
       root   html/code;
       index  index.php index.html index.htm;
        if (!-e $request_filename) {
             rewrite  ^(.*)$  /index.php?s=$1  last;
             break;
        }
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/ttlad.test-error.log error;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php {
         fastcgi_pass  unix:/var/run/php/php7.2-fpm.sock;
         fastcgi_index  index.php;
         include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
    }

    location ~ /\.ht {
        deny all;
    }

    ssl_certificate     /etc/nginx/ssl/ttlad.test.crt;
    ssl_certificate_key /etc/nginx/ssl/ttlad.test.key;
}

你可能感兴趣的:(Vagrant中Nginx对应Thinkphp3.2配置)