Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Wordpress site running in a Vagrant development environment. When I load up http://localhost:8080, the site comes up fine, but as soon as I try to access the admin by going to http://localhost:8080/wp-admin, I'm redirected to http://localhost/wp-admin/.

Two things here:

  1. Nginx is forcing the trailing slash (which I'm not doing intentionally, afaik, but would be fine).
  2. In the trailing slash redirection, the port is getting lost (which is very much not fine).

I've tried adding the port_in_redirect directive (using both values, to be honest) that I've seen in other answers to similar questions, but it changed nothing.

Any idea what I'm missing?

share|improve this question

You need to use proxy_redirect to modify the response header so localhost is rewritten to localhost:8080

share|improve this answer
Well, here's the thing. As far as I can tell, it's WP doing the redirection, not Nginx. proxy_redirect looks like it performs a redirection which isn't something I need to do. Am I reading that wrong? – Rob Wilkerson Jan 30 '13 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.