zlzyp 发表于 2018-11-14 11:17:58

nginx(二)初识配置文件

38  39         #charset koi8-r;#设置使用字符集
  40
  41         #access_loglogs/host.access.logmain;#访问日志文件存放路径
  42
  43         location / {
  44             root   html;#网页存放的目录,也可是绝对路径
  45             indexindex.html index.htm;#默认首页顺序
  46         }
  47
  48         error_page404            /404.html;
  49
  50         # redirect server error pages to the static page /50x.html
  51         #
  52         error_page   500 502 503 504/50x.html;
  53         location = /50x.html {
  54             root   html;
  55         }
  56
  57         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  58         #
  59         #location ~ \.php$ {
  60         #    proxy_pass   http://127.0.0.1;
  61         #}
  62
  63         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  64         #
  65         #location ~ \.php$ {
  66         #    root         html;
  67         #    fastcgi_pass   127.0.0.1:9000;
  68         #    fastcgi_indexindex.php;
  69         #    fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
  70         #    include      fastcgi_params;
  71         #}
  72
  73         # deny access to .htaccess files, if Apache's document root
  74         # concurs with nginx's one
  75         #
  76         #location ~ /\.ht {
  77         #    denyall;
  78         #}
  79   }
  80
  81
  82   # another virtual host using mix of IP-, name-, and port-based configuration
  83   #
  84   #server {
  85   #    listen       8000;
  86   #    listen       somename:8080;
  87   #    server_namesomenamealiasanother.alias;
  88
  89   #    location / {
  90   #      root   html;
  91   #      indexindex.html index.htm;
  92   #    }
  93   #}
  94
  95
  96   # HTTPS server
  97   #
  98   #server {
  99   #    listen       443;
  100   #    server_namelocalhost;
  101
  102   #    ssl                  on;
  103   #    ssl_certificate      cert.pem;
  104   #    ssl_certificate_keycert.key;
  105
  106   #    ssl_session_timeout5m;
  107
  108   #    ssl_protocolsSSLv2 SSLv3 TLSv1;
  109   #    ssl_ciphersALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  110   #    ssl_prefer_server_ciphers   on;
  111
  112   #    location / {
  113   #      root   html;
  114   #      indexindex.html index.htm;
  115   #    }
  116   #}
  117
  118 }
  =========================================================

页: [1]
查看完整版本: nginx(二)初识配置文件