0

I need a small help in writing nginx rule for redirecting a subfolder to subdomain as shown below

http://www.example.com/test to test.domain.com

Thanks

kiran
  • 23
  • 3
  • possible duplicate of [nginx - redirect a certain path to another domain](http://stackoverflow.com/questions/3017677/nginx-redirect-a-certain-path-to-another-domain) – mlt Aug 23 '15 at 07:13

1 Answers1

0

If you are in the www.example.com virtual host just write this line in the config:

rewrite ^/test http://test.domain.com;
michelem
  • 14,430
  • 5
  • 50
  • 66