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

原文出处:cnblogs -> http://www.cnblogs.com/300js/p/7655990.html

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如果侵犯你的利益,请发送邮箱到 [email protected],我们会很快的为您处理。