nginx原配置
#原配置 server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
nginx -s reload 重启
#user nobody;
worker_processes ; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
} 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"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen ;
# listen somename:;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
nginx原配置的更多相关文章
- 《深入理解Nginx》阅读与实践(一):Nginx安装配置与HelloWorld
最近在读陶辉的<深入理解Nginx:模块开发与架构解析>,一是想跟着大牛练练阅读和编写开源代码的能力,二是想学学Nginx优秀的架构设计,三是想找一个点深入下Linux下网络编程的细节.侯 ...
- Linux Nginx 安装配置
安装前准备工作 GCC编译器-程序代码编译工具! 首先检验你的服务器环境是否安装gcc,方法如下: #gcc 如果出现:gcc: no input files 证明已经安装过gcc编译工具! 如果出现 ...
- Centos6.5 nginx+nginx-rtmp配置流媒体服务器
之前使用命令方式安装nginx并配置了反向代理,由于想做一个视频直播的小项目,查了流媒体服务器的方案,发现nginx有相关模块,于是开始搞起. nginx-rtmp模块需要在nginx编译时,以模块方 ...
- Nginx安装配置与HelloWorld
<深入理解Nginx>阅读与实践(一):Nginx安装配置与HelloWorld 最近在读陶辉的<深入理解Nginx:模块开发与架构解析>,一是想跟着大牛练练阅读和编写开源代码 ...
- Nginx学习——Nginx基本配置
1.Nginx的配置文件总览 Nginx配置文件详解 : http://www.cnblogs.com/hunttown/p/5759959.html nginx.conf 基本格式: worker_ ...
- nginx的配置与应用
Nginx在应用程序中主要有以下作用(应用):1.解决跨域.2.请求过滤.3.配置Gzip.4.负载均衡.5.静态资源服务器. Nginx的配置结构 Nginx主要是通过修改配置文件nginx.con ...
- 高性能Web服务器Nginx的配置与部署研究(7)核心模块之主模块的非测试常用指令
1. error_log 含义:指定存储错误日志的文件 语法:error_log <file> [debug|info|notice|warn|error|crit] 缺省:${prefi ...
- nginx里配置跨域
发布于 881天前 作者 wendal 1404 次浏览 复制 上一个帖子 下一个帖子 标签: nginx 跨域 if ($request_method = OPTIONS ) { add ...
- Nginx的配置文件简介及在Nginx中配置基于不同ip的虚拟主机
Nginx的配置文件简介及在Nginx中配置基于不同ip的虚拟主机: #user nobody; worker_processes 1; #error_log logs/error.log; #err ...
随机推荐
- mongodb测试类
public class MongoManager { private static final String MONGO_DBNAME="local"; private stat ...
- ios之UISegmentedcontol
初始化UISegmentedControl NSArray *arr = [[NSArray alloc]initWithObjects:@"轻拍",@"长按" ...
- 使用 ss 命令查看连接信息
作用:打印主机socket连接信息,netstate可以做的它都可以做,比netstate 更灵活,而且由于ss使用 tcp_diag 内核模块,所以速度更快. 用法: ss [ OPTIONS ] ...
- golang 实现冒泡排序
package main import ( "fmt" ) func main(){ a := [...] int{2,5,9,6,8} fmt.Println(a) num := ...
- 解决zend studio代码无法自动提示的3个方法
最近电脑重装,索性把用了好多年的老版本7.x 升级了,网上下载了一个12.x的破解版. 起初一切正常,等导入项目开始开发的时候发现PHP函数尽然没有提示,一脸懵逼! 经过多方查阅和尝试,现在分享3个解 ...
- Vector模板类----构造与析构
/* 基于C++平台*/ typedef int rank; //用int来定义 “秩” 这种概念 #define DEFAULT_CAPACIITY 3 //默认初始容量,实际应用中可以取更大的值 ...
- 代理授权验证_web客户端授权验证
HTTPPasswordMgrWithDefaultRealm() HTTPPasswordMgrWithDefaultRealm()类将创建一个密码管理对象,用来保存 HTTP 请求相关的用户名和密 ...
- bash快捷键及输入输出重定向
bash特性之快捷键: Ctrl+a: 跳转至命令首部 Ctrl+e: 跳转至命令尾部 Ctrl+l: 清屏 Ctrl+c: 中止或取消 Ctr ...
- PHP-redis命令之 字符串 (strings)
一.string (字符串) 1.set:设置键 $reids->set('mykey',111); 2.get:获取键 $redis->get('mykey'); 3.del:删除键 $ ...
- Hibernate的Session的get()和load()方法区别
hibernate中Session接口提供的get()和load()方法都是用来获取一个实体对象,在使用方式和查询性能上有一些区别. get Session接口提供了4个重载的get方法,分别通过“持 ...