Giter Club home page Giter Club logo

learn-nginx's Introduction

learn-nginx

学习安装、配置nginx, 如果你有什么想学习的case或者想完成某些配置, 可在 issues 创建~

在学习之前你可能需要掌握的

  • linux服务器和一些常用的操作命令
  • 域名,当然如果是本地玩玩也可以是Hosts
  • 基本的正则表达式

list

修改配置文件后需要重启、刷新nginx服务, 如: [sudo] nginx -s reload

常见错误和解决方法

nginx: [emerg] getpwnam("nginx") failed

表示该用户nginx不存在, 解决方法:

  1. nginx.conf里添加user nobody;
  2. 创建用户和用户对应的分组

nginx: [emerg] getgrnam("xiaowu") failed

表示用户分组不存在, 解决方法:

  1. nginx.conf里添加user nobody;
  2. 创建用户对应的分组

nginx: [alert] could not open error log file: open() "/logs/error.log" failed (13: Permission denied)

启动nginx的用户权限不够导致无法写入日志文件, 常见于非root用户启动报错

nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)

80端口被占用启动失败, 修改端口或者杀死占用者再启动即可

nginx: [error] open() "nginx.pid" failed (2: No such file or directory)

pid进程id文件不存在, 可能文件被删除或者已经停止, 在停止nginx时会使用该进程id, 如果不存在将失败, 可以手动kill掉

nginx: [emerg] unknown "realpath_roots_xxx" variable

变量$realpath_roots_xxx不存在

nginx: [emerg] "add_header" directive is not allowed here in xx

add_header指令不能直接在if判断内, 可以在httpserverserver.locationserver.location.if

learn-nginx's People

Contributors

xuexb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.