Reputation: 2669
I would like to know how I can achieve the following using the nginx rewrite module, I do not have much experience with regex.
I would like to redirect a URL from
www.example.com/foo/1/bar/2/
rewrite to:
www.example.com:9000/foo/1/bar/2/
thanks
Upvotes: 0
Views: 1424
Reputation: 7403
server {
listen 80;
server_name www.example.com;
rewrite ^(.*)$ $scheme://www.example.com:9000$1 redirect;
}
Upvotes: 1