WordPress behind reverse proxy: Session cookies are not set in Safari & IE

I have a WordPress blog working for reverse proxy (Apache).

httpd.vhosts.conf:

<VirtualHost  *:80>
    ServerName blog.domain.com:80
    ServerAlias www.blog.domain.com
    ProxyPass / http://192.168.101.11/blog/
    ProxyPassReverse / http://192.168.101.11/blog/
</VirtualHost>

The blog works fine, I can log in as admin, but when I try to save the settings or remove the plugin (and wp_redirect happens). I am redirected to the login page because Wordpress obviously doesn’t work to find / accept the session cookie and the action will not be completed.

So I added this line:

    ProxyPassReverseCookiePath / http://192.168.101.11/blog/

(see Apache proxy cookie only works with the first application )

, , . , , , Safari IE ( Opera, Firefox, Chrome). .

:

  • cookie wordpress_test_cookie admin Safari, , "__uc*" .. ( ). ProxyPassReverseCookiePath -entry .
  • cookie ( ), .
  • WP-cookies :

WP-config.php

define('COOKIE_DOMAIN', '.blog.domain.com');
define('COOKIEPATH', '/');
define('SITECOOKIEPATH', '/');
define('ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
+4
2

:

cookie. :

ProxyPassReverseCookiePath http://192.168.101.11/blog http://blog.domain.com
+4

ProxyPassReverseCookiePath path cookie. , URL- . , ProxyPassReverseCookiePath, , Wordpress COOKIEPATH.

:

ProxyPassReverseCookiePath /blog/ /
ProxyPassReverseCookieDomain 192.168.101.11 .blog.domain.com

path, domain cookie, , , , wp-config.php.

+2

Source: https://habr.com/ru/post/1525397/


All Articles