2

I setup my wordpress in a docker container, use nginx reverse proxy to forward all requests of location /blog to that docker container.

The problem is after logging in to wp-admin, it redirected to domain/wp-admin/ instead of /domain/blog/wp-admin.

What's the problem? I've set WP_SITE_URL and WP_HOME to /blog

Thịnh Phạm
  • 2,528
  • 5
  • 26
  • 39

1 Answers1

9

This is what I did to fix it:

// add these lines to wp-config.php
define('WP_SITE_URL', 'http://domain.com/blog');
define('WP_HOME', 'http://domain.com/blog');

$_SERVER['REQUEST_URI'] = '/blog' . $_SERVER['REQUEST_URI'];
Thịnh Phạm
  • 2,528
  • 5
  • 26
  • 39