nginx配置指南
来源:互联网 发布:组态软件免费下载 编辑:程序博客网 时间:2024/06/05 02:47
停止 nginx -s stop
启动 nginx
配置 conf 下的nginx.conf 中的location->root 设置首页
安装nginx----------------------------------------------------------------------------------------
1.安装pcre (ubantu: apt-get install pcre \ centos:rpm -ivh pcre)
2.安装nginx (ubantu: apt-get install nginx \ centos:rpm -ivh nginx)
3.配置conf nginx.conf location->root
4.多配置 多个location /otherpath(~^ 等等)
详情可参考:http://www.runoob.com/linux/nginx-install-setup.html
启动 nginx
配置 conf 下的nginx.conf 中的location->root 设置首页
安装nginx----------------------------------------------------------------------------------------
1.安装pcre (ubantu: apt-get install pcre \ centos:rpm -ivh pcre)
2.安装nginx (ubantu: apt-get install nginx \ centos:rpm -ivh nginx)
3.配置conf nginx.conf location->root
4.多配置 多个location /otherpath(~^ 等等)
详情可参考:http://www.runoob.com/linux/nginx-install-setup.html
nginx配置基本结构:http{ server{ location{ } } }
这里主要讲nginx的配置文件
user www-data;worker_processes 4;pid /run/nginx.pid;events {worker_connections 768;#最大连接数# multi_accept on;}http {sendfile on;#是否支持文件下载tcp_nopush on;#tcp禁止推送tcp_nodelay on;#tcp禁止延时发送请求,一一回应,不采用打包发送的算法keepalive_timeout 65;#超时时间types_hash_max_size 2048;#文件上传大小MB# server_tokens off; #采用令牌方式# server_names_hash_bucket_size 64;#缓冲空间大小# server_name_in_redirect off;#是否开启重定向,重定向会自动解析Local>http://blog.csdn.net/weiyuefei/article/details/38556593include /etc/nginx/mime.types;#支持哪些方式访问default_type application/octet-stream;### Logging Settings 日志系统##access_log /var/log/nginx/access.log;error_log /var/log/nginx/error.log;### Gzip Settings 压缩支持##gzip on;gzip_disable "msie6";#对于IE6不压缩# gzip_vary on;#开启压缩缓存# gzip_proxied any;# 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩# gzip_comp_level 6;#压缩级别,越小越快压缩效果越差# gzip_buffers 16 8k;#压缩流大小# gzip_http_version 1.1;#http协议版本# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;### nginx-naxsi config### Uncomment it if you installed nginx-naxsi###include /etc/nginx/naxsi_core.rules;#防攻击的配置 include后就不需要在这个文件里面配置了 http://www.2cto.com/article/201308/238947.html### nginx-passenger config### Uncomment it if you installed nginx-passenger###passenger_root /usr;#passenger_ruby /usr/bin/ruby;### Virtual Host Configs##include /etc/nginx/conf.d/*.conf;include /etc/nginx/sites-enabled/*;# 8000 server yy 文件服务器server { listen 8000; #指定端口 server_name file;#名称 charset utf-8;#编码 root /data/nginxfile ;#根目录 autoindex on;#自动索引文件autoindex_exact_size off;#自动索引大小autoindex_localtime on;#展示文件为服务器时间 }# static server 80 静态服务器 server { listen 80; server_name yimaodang.cn;#访问该关键词(网站)时跳转到这个server charset utf-8; root /data/staticweb/WebContent;#根目录 index index.html index.htm;#指定首页#这些类型的文件缓存时间是30天location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ { expires 30d; }}}#mail { 邮件服务器,不建议用这个...## See sample authentication script at:## http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript# ## auth_http localhost/auth.php;## pop3_capabilities "TOP" "USER";## imap_capabilities "IMAP4rev1" "UIDPLUS";# #server {#listen localhost:110;#protocol pop3;#proxy on;#}# #server {#listen localhost:143;#protocol imap;#proxy on;#}#}
求关注,相互交流喔0 0
- Nginx:配置指南(1)
- Nginx:配置指南(2)
- Nginx Location配置指南
- nginx配置指南
- Nginx:配置指南
- Nginx指南和配置详解
- Nginx + https + 免费SSL证书配置指南
- Nginx + https + 免费SSL证书配置指南
- Nginx + https + 免费SSL证书配置指南
- nginx ssl加密代理配置指南
- nginx基础配置指南 - 配置文件语法
- 服务器证书安装配置指南(Nginx)
- Nginx基本配置、性能优化指南
- Nginx + https + 免费SSL证书配置指南
- Nginx基本配置、性能优化指南
- Nginx基本配置、性能优化指南
- Nginx + https + 免费SSL证书配置指南
- Nginx基本配置、性能优化指南
- DropEditText可拉伸EditText
- HotApp云笔记
- Javascript:谈谈JS的全局变量跟局部变量
- 02-gradle的安装
- 用tagcloud插件制作的超炫酷“云标签”(3D旋转和平铺),附前后台代码及标签配置页面
- nginx配置指南
- Java关键字final、static使用总结
- a~z
- CodeForces 375C
- picasso,glide两种图片框架
- 支付宝支付流程
- 从博弈论谈谈入坑学编程
- 《番茄工作法图解》
- 用递归求阶乘