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

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

1 Answer 1

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.