nginx相关配置
不同操作系统下的相关命令
widows下
命令 | 解释 |
---|---|
start nginx.exe | 启动nginx |
nginx.exe -s reload | 重启nginx |
nginx.exe -s stop/quit | 停止nginx |
nginx.exe -s open | 打开日志文件 |
nginx -v | 查看nginx版本 |
linux 下
命令 | 解释 |
---|---|
./nginx.exe | 启动nginx |
nginx.exe -s reload | 重启nginx |
nginx.exe -s stop/quit | 停止nginx |
nginx.exe -s open | 打开日志文件 |
nginx -v | 查看nginx版本 |
config 配置
属性名字 | 解释 |
---|---|
listen | 启动时的监听端口,就是启动端口 |
server_name | niginx启动后请求的路径 |
proxy_pass | 代理服务器地址;使用:location /a/ { proxy_pass http://localhost/; # 请求 /a/b/c ;代理后 http://localhost/b/c.如果 proxy_pass http://localhost; 就是结尾没有 ‘/’ 那么他的结果就是 http://localhost/a/b/c } |
proxy_redirect | 默认值 default (可选值 off ,redirect replacement) |