1

I need to setup virtualhost on nginx for wildfly server. i was using apache virtual host earlier and i want to do similar settings in nginx I have followed steps given in this article http://nginx.org/en/docs/http/request_processing.html and http://developer-should-know.tumblr.com/post/112512171397/nginx-serving-static-content-and-java-application

Here is my conf file

server {
  listen      80;
  server_name  www.example.com;
  access_log  logs/www.example.com_access.log;
  error_log logs/www.example.com_error.log;

   location / {
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  proxy_pass           http://127.0.0.1:8080;
 root /var/www/www.example.com/public_html;
   index  index.html ;
    try_files $uri $uri/ =404;
    }
   error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   html;
  }
}

In my root directory i have index.html

<html>
<head>
<meta http-equiv="Refresh" content="0;url=/Test/hello.jsp">
<title>Index Redirect</title>
</head>
</body>

I need to send my request from http://127.0.0.1:8080/ to my root directory index.html which will redirect to /Test/hello.jsp;

How to achieve this.Please suggest me what i am doing wrong here

kirti
  • 111
  • 5

0 Answers0