type
status
date
slug
summary
tags
category
icon
password
安装nginx
yum -y install nginx启动
service nginx start停止
service nginx stop重启
service nginx restart测试nginx配置
nginx -t配置文件目录
/etc/nginx/nginx.confindex 路径
/usr/share/nginx/html负载均衡
- 在
nginx.conf下添加:
- 在
nginx.conf中有include /etc/nginx/conf.d/*.conf;,去conf.d文件夹下添加自定义配置文件
静态代理
在
nginx.conf中有 include /etc/nginx/conf.d/*.conf;,去conf.d文件夹下添加自定义配置文件(随意命名,只要是.conf结尾即可。)需要在域名解析中添加相应的二级域名解析。https
主要配置如下,
location 和http 一样支持全站加密,在 http 的 server 里增加
rewrite ^(.*) https://$host$1 permanent;如果需要做 https 下的反向代理
错误处理
FTP
只需在
location中配置: