Home > other >  Nginx position fix: redirect to the index. The HTML
Nginx position fix: redirect to the index. The HTML

Time:10-12

I'm running nginx v 1.0.4, we are trying to do the following:

The location ~ ^/${
Rewrite ^. * $/index. HTML last;
}

Basically, if the user to the default domain http://www.foo.com or http://www.foo.com/to be redirected to the http://www.foo.com/index.html
When I add it to my file, I get the following contents: in the/etc/nginx/myconf conf in nginx start: nginx: [emerg] unknown instructions ""
Thank you in advance.

CodePudding user response:

You can use in the absence of position to rewrite the function

Rewrite ^/$/index. HTML last;

Or permanent redirect

Rewrite ^/$/index. HTML permanent;

Rewrite with parameters, such as http://www.foo.com/? Param=value - & gt; http://www.foo.com/index.html? Param=value

Rewrite ^/(\? . *)? $/index. The HTML $1 permanent;

CodePudding user response:

The location/{
Root/home/OBE.
The index login interface. HTML;
}
So why don't configure direct access to the IP automatically jump to the login screen. The HTML
But an error 403
  • Related