nginx 整合 tomcat 疑惑,nginxtomcat
nginx 整合 tomcat 疑惑,nginxtomcat
启动/user/local/nginx/sbin/nginx
重启 /user/local/nginx/sbin/nginx -s reload
停止 /user/local/nginx/sbin/nginx -s stop
停止 ps -ef | grep nginx
强制停止Nginx pkill -9 nginx
vi nginx.conf 末尾加上,最后一个大括号前加
#} include vhost/*.conf;
}
[root@localhost conf]# mkdir vhost
[root@localhost conf]# vi younila.conf
# demo site server {
listen 80; server_name www.younila.com; set $htdocs /webapps/younila/; root $htdocs;
location / { index index.html index.htm index.action; }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|css|js|html)$ { expires 30d; }
location ~*\.(jsp|do|action)$ { index index.jsp; proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~^/(WEB-INF)/{ deny all; }
}
tomcat server.xml 加入 <Context path="" docBase="/webapps/younila" crossContext="true" debug="0" reloadable="true"/>
评论暂时关闭