#原配置

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原配置的更多相关文章

  1. 《深入理解Nginx》阅读与实践(一):Nginx安装配置与HelloWorld

    最近在读陶辉的<深入理解Nginx:模块开发与架构解析>,一是想跟着大牛练练阅读和编写开源代码的能力,二是想学学Nginx优秀的架构设计,三是想找一个点深入下Linux下网络编程的细节.侯 ...

  2. Linux Nginx 安装配置

    安装前准备工作 GCC编译器-程序代码编译工具! 首先检验你的服务器环境是否安装gcc,方法如下: #gcc 如果出现:gcc: no input files 证明已经安装过gcc编译工具! 如果出现 ...

  3. Centos6.5 nginx+nginx-rtmp配置流媒体服务器

    之前使用命令方式安装nginx并配置了反向代理,由于想做一个视频直播的小项目,查了流媒体服务器的方案,发现nginx有相关模块,于是开始搞起. nginx-rtmp模块需要在nginx编译时,以模块方 ...

  4. Nginx安装配置与HelloWorld

    <深入理解Nginx>阅读与实践(一):Nginx安装配置与HelloWorld 最近在读陶辉的<深入理解Nginx:模块开发与架构解析>,一是想跟着大牛练练阅读和编写开源代码 ...

  5. Nginx学习——Nginx基本配置

    1.Nginx的配置文件总览 Nginx配置文件详解 : http://www.cnblogs.com/hunttown/p/5759959.html nginx.conf 基本格式: worker_ ...

  6. nginx的配置与应用

    Nginx在应用程序中主要有以下作用(应用):1.解决跨域.2.请求过滤.3.配置Gzip.4.负载均衡.5.静态资源服务器. Nginx的配置结构 Nginx主要是通过修改配置文件nginx.con ...

  7. 高性能Web服务器Nginx的配置与部署研究(7)核心模块之主模块的非测试常用指令

    1. error_log 含义:指定存储错误日志的文件 语法:error_log <file> [debug|info|notice|warn|error|crit] 缺省:${prefi ...

  8. nginx里配置跨域

    发布于 881天前  作者 wendal  1404 次浏览  复制  上一个帖子  下一个帖子  标签: nginx 跨域 if ($request_method = OPTIONS ) { add ...

  9. Nginx的配置文件简介及在Nginx中配置基于不同ip的虚拟主机

    Nginx的配置文件简介及在Nginx中配置基于不同ip的虚拟主机: #user nobody; worker_processes 1; #error_log logs/error.log; #err ...

随机推荐

  1. Greenplum介绍-table

    GP中的table和其它关系型数据表是一样的,除了数据被分布在不同的segment以外. 建表时需定义以下几个方面:1. 指定列和数据类型2. 约束3. 分布策略4. 数据存储方式5. 大表分区策略 ...

  2. 【简●解】 LG P2730 【魔板 Magic Squares】

    LG P2730 [魔板 Magic Squares] [题目背景] 在成功地发明了魔方之后,鲁比克先生发明了它的二维版本,称作魔板.这是一张有8个大小相同的格子的魔板: 1 2 3 4 8 7 6 ...

  3. Watch Before You Feel Pressure

    Today's assembly is about the start of a journey. 今天的大会是一个旅程的开始. The start of the rest of your lives ...

  4. hihoCoder-1093-SPFA

    SPFA的卓越之处就在于处理多点稀疏图,因为点太多的话,我们直接用矩阵来存图的话是存不下的. 所以当我们用邻接矩阵来存图的话,我们就可以用SPFA来解决这类问题,spfa就是优化版的bellman-f ...

  5. 文件操作-cp

    Linux cp命令 也是我们在实际使用中非常常用的一个命令,主要用来复制文件.文件夹等.今天就来给大家介绍下 cp命令 的使用. 转载自 https://www.linuxdaxue.com/lin ...

  6. node.js----服务器http

    请求网址过程: 1.用户通过浏览器发送一个http的请求到指定的主机 2.服务器接收到该请求,对该请求进行分析和处理 3.服务器处理完成以后,返回对应的数据到用户机器 4.浏览器接收服务器返回的数据, ...

  7. Ubuntu 清理卸载残留文件

    dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

  8. MFC下拉框

    在函数OnInitDialog()中添加一下语句可以添加选项到下拉框中 m_comboBox.AddString(_T("ALKATIP Basma Tom")); m_combo ...

  9. Hive中文注释乱码解决方案(2)

    本文来自网易云社区 作者:王潘安 执行阶段 launchTask    回到Driver类的runInternal方法,看以下执行过程.在runInternal方法中,执行过程调用了execute方法 ...

  10. iOS视图边框的简单做法

    我们绘制UI界面的时候,一般我们做边框是用layer,然后再给它上面添加阴影什么的,我比较喜欢用下面这个方法, UI弄几张边框的图片,用代码给图片拉伸 - (UIImage *)changeBorde ...