nginx 新手,请教点配置问题。

xiangzhongxia 2014-07-20 03:55:27

server {
listen 80;
server_name fanjianlu.com;
server_name www.fanjianlu.com;
root /home/webfile;
index index.html index.htm;

location ~ .*\.(htm|html)$
{
root /home/webfile; #set resource file
expires 1h;
}


location ~ .*\.(js|css)$
{
root /home/webfile; #set resource file
expires 1h;
}

location ~ .*.(action*|jsp*)$ #is jsp and action and .do from tomcat
{
index index.action;
proxy_pass http://211.149.207.191:8080;#ret url from tomcat
}

location ~ .*\.(ico|gif|jpg|jpeg|png|bmp|swf|txt|html|htm)$ #Set access to static files directly read without tomcat
{
root /home/webfile; #The default Web site root directory location defined server
expires 30d;
}

location / {
proxy_pass http://211.149.207.191:8080;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
ssi on;
ssi_silent_errors on;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}


我这里由于是tomcat 里面的action无后缀名,现在tomcat能够访问,文件也能够访问但是就是直接输入域名index.html跳转到tomcat下面去了。我想要直接输入域名能进入/home/webfile 目录
...全文
80 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧