nginx整合jeecg怎么配置?
jeecg的小项目终于完成了,想部署到一个linux服务器上,用nginx整合,直接用80端口访问,但是老是报404错误,请问这个配置文件该怎么配置呢?server{
listen 80;
server_namewww.aaa.com
index login.jsp;#设定访问的默认首页地址
root/usr/local/tomcat/webapps/ROOT/OA;#设定网站的资源存放路径
#limit_conn crawler20;
location /{
root /usr/local/tomcat/webapps/ROOT/OA;
indexindex.html index.htm index.jsp login.jsp;
}
location ~ .*.jsp$ #所有jsp的页面均交由tomcat处理
{
index index.jsp login.jsp;
# proxy_pass http://localhost:8080;#转向tomcat处理
proxy_redirect http://oa.sstx99.com http://127.0.0.1:8080/OA;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_buffers 32 4k;
proxy_connect_timeout 3;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_pass http://127.0.0.1:8080;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ #设定访问静态文件直接读取不经过tomcat
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
}
页:
[1]