环境:[centos_6.5+nginx_1.6.2]
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum localinstall nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum install nginx
全部指向tomcat8080端口,修改文件/etc/nginx/conf.d/default.conf,内容如下
server {
listen 80;
server_name localhost;
location / {
index index.jsp;
proxy_pass http://localhost:8080;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
常用命令:
To start nginx, run the executable file. Once nginx is started, it can be controlled by invoking the executable with the -s parameter. Use the following syntax:
nginx -s signal
Where signal may be one of the following:
stop — fast shutdown
quit — graceful shutdown
reload — reloading the configuration file
reopen — reopening the log files