nginx 基本配置
来源:互联网 发布:java 301跳转 编辑:程序博客网 时间:2024/05/22 06:39
user www-data; #进程用户
worker_processes 4;
pid /run/nginx.pid;# 进程ID
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
server {
listen 80 ;
root /var/www/html/cms/; #项目目录
# Make site accessible from http://localhost/
server_name www.yxzj520.com; #域名
location / {
index index.php; #首页 当用/访问时,定位到inex,.php并把参数呆过去
try_files $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ { #处理.php的访问
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
# location ~ /\.ht {
# deny all;
# }
}
}
worker_processes 4;
pid /run/nginx.pid;# 进程ID
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
server {
listen 80 ;
root /var/www/html/cms/; #项目目录
# Make site accessible from http://localhost/
server_name www.yxzj520.com; #域名
location / {
index index.php; #首页 当用/访问时,定位到inex,.php并把参数呆过去
try_files $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ { #处理.php的访问
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
# location ~ /\.ht {
# deny all;
# }
}
}
0 0
- Nginx的基本配置
- Nginx基本安装配置
- 【Nginx】基本配置入门
- Nginx 基本配置知识
- nginx 基本配置分析
- nginx 基本配置说明
- Nginx服务器基本配置
- nginx 基本配置
- nginx的基本配置
- nginx基本配置
- nginx 基本配置
- nginx 的基本配置
- Nginx基本配置
- nginx基本配置
- Nginx基本配置讲解
- nginx基本配置整理
- Nginx--基本配置-简介
- nginx基本配置学习
- Spring事务属性
- TextView文本数值保留一位小数,并显示递增动画(0~当前数值)
- Undefined symbols for architecture i386: "_fwrite$UNIX2003",在集成环信SDK,UI的时候遇到的问题总结
- IIS8.5关于“配置错误 不能在此路径中使用此配置节”的解决办法
- Spring几大注解类的详解与区别
- nginx 基本配置
- android基础学习之通知
- hdu1978 How many ways
- [51]简单按键计数程序
- Android-PullToRefresh-master使用心得
- 关于linux模块驱动简单的Makefile
- textview、edittext下划线边框,以及圆弧边框的添加
- 一个学习网站
- 《leetCode》:House Robber III