---
title: "ngnix使用"
author: "shicheng"
date: "2011-10-13T15:36:42Z"
tags: []
categories: ["开源软件"]
slug: "ngnix"
draft: false
lastmod: "2011-10-13T15:36:42Z"
id: 1194620
url: "https://benchild.iteye.com/blog/1194620"
---

1.nginx linux 安装  
./configure --prefix=/opt/nginx/ --sbin-path=/opt/nginx/   
2.nginx启动相关命令

启动：start nginx.exe

重启:nginx -s reload | reopen

停止：nginx -s quit | stop

3.nginx配置

     location /

    {

  expires 30d | 1h #这只缓存时间

  index index.html   #默认首页

  root /data/web/  #html文件的目录

        autoindex on|off (没有默认首页的目录，是否显示文件列表)

        autoindex\_exact\_size b|kb|mb|gb (文件大小的单位)

        autoindex\_localtime on|off (文件的时间)

    }