zoukankan      html  css  js  c++  java
  • 配置laravel的nginx站点

    server{}配置
    server{
            #端口配置
            listen 80;
            #域名配置
            server_name laravel.cc;
    
            index index.php index.html index.htm;
            #站点配置到public
            root /data/wwwroot/laravel.cc/public;
          #日志记录
            access_log /data/logs/nginx.laravel.cc.log access;
            error_log /data/logs/nginx.laravel.cc.error debug;
         #静态文件配置
            location ~ .*.(jpg|jpeg|gif|png|bmp|css|js|swf|txt|ttf|woff|ico)$ {
                    expires 7d;
                    break;
            }
    
            location / {
             #重点区
                    try_files $uri $uri/ /index.php?$query_string;
                    index index.php index.html index.htm;
            }
            #静态文件配置
            location /logs {
                    autoindex on;
                    autoindex_exact_size off;
                    autoindex_localtime on;
                    break;
            }
            #处理php配置
            location ~ ".php$" {
                    include fastcgi_params;
                    fastcgi_index index.php;
                    #在nginx.conf配置server_mango
                    fastcgi_pass server_mango;
            }
    }
    

      

    http下的server_mango配置

      

    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        log_format access '$remote_addr [$time_local] "$http_host" "$request" "$status $body_bytes_sent" "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
        #access_log  logs/access.log  main;
    
        sendfile        on;
        tcp_nopush     on;
        server_tokens       off;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        gzip on;
        gzip_min_length  5k;
        gzip_buffers     4 16k;
        #gzip_http_version 1.0;
        gzip_comp_level 3;
        gzip_types       text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
        gzip_vary on;
        #重点区与server{}中的处理php应用到的
        upstream server_mango {
            server 127.0.0.1:9000;
        }
        #加载vhost下的.conf后缀所有文件
        include /usr/local/nginx/conf/vhost/*.conf;
    }
    

      

  • 相关阅读:
    greenplum表的distributed key值查看
    oracle dump的使用心得
    Linux du与df命令的差异
    从语言只是工具说起
    DDD领域模型
    同一个对象在另一个对象中容易出现重复引用造成map覆盖,HiJson出现严重漏洞自动删除了$ref和空值
    乒乓球相关
    字符串转xml
    最新版java题
    list集合进行分页
  • 原文地址:https://www.cnblogs.com/300js/p/7655990.html
Copyright © 2011-2022 走看看