I have a vagrant vm running nginx on port 80. My host machine forwards port 8080 to the vagrant vm's port 80.
I need to rewrite a url with a 301 redirect, which works, but the port I use to access nginx through the tunnel (8080) is dropped and the redirect fails.
http://server.com:8080/blog/two
-becomes-
http://server.com/blog.php?article=two
- it should be -
http://server.com:8080/blog.php?article=two
example:
rewrite ^/blog/(.*)$ /blog.php?article=$1 last;
Thanks!