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;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • I/O模型: 阻塞型、非阻塞型、复用型、信号驱动型、异步 同步/异步:关注消息通知机制 消息通知:同步:等待对方返...
    Net夜风阅读 2,131评论 0 1
  • Nginx简介 解决基于进程模型产生的C10K问题,请求时即使无状态连接如web服务都无法达到并发响应量级一万的现...
    魏镇坪阅读 2,231评论 0 9
  • 服务器https配置 配置https操作说明文档 1、查看服务器环境配置(tomcat和apache合并使用) 2...
    南京杨小兵阅读 9,255评论 0 9
  • 一安装nginx yum installnginx.x86_64 二配置 nginx conf 1.反向代理+负载...
    QTong阅读 286评论 0 0
  • vhost 样例 server { listen 80; server_name check.32116...
    麦子时光_新浪阅读 403评论 0 0

友情链接更多精彩内容