安装:
yum install -y nginx
路径:
/etc/nginx
日志路径:
/var/log/nginx/
启动命令:
nginx
检测命令
nginx -t
平滑重启命令
nginx -s reload
在/etc/nginx/conf.d目录下可新增自己的配置文件以.conf结尾
如/etc/nginx/conf.d/center.conf 文件配置类容如下:
#------------------------------------------------------------------------------------------------------------------
server {
listen 80;
server_name center-uat.51qianyun.cn;
location / {
proxy_pass http://ip:port;
proxy_set_header Host $host;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
# 配置ssl
server {
listen 443;
server_name center-uat.51qianyun.cn;
ssl on;
ssl_certificate *********.pem;
ssl_certificate_key ************.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://ip:port;
proxy_set_header Host $host;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
#------------------------------------------------------------------------------------------------------------------