Mauro
Mauro

Reputation: 189

wordpress behind proxy pass - admin authentication does't work

i am in trouble...

I have a wordpress blog behing an SSL reverse Proxy.

Wordpress lives inside Docker.

Everything works fine, except for the admin panel.

When I try to login, I got the message

"You do not have sufficient permissions to access this page"

I got two cookies, "wordpress_loggedin_XXXXX" and "wordpress_sec_XXXXX" because I am on a SSL connection.

On my Docker local machine everything works, is NOT a database prefix issue.

here is the screenshot of my admin panel, with cookies

Please help me! Thx you in advance guys!!

Upvotes: 0

Views: 1169

Answers (1)

Mauro
Mauro

Reputation: 189

Ok, I got the solution! ... I write here, maybe can be helpful.

In my wp-config.php,

I added these lines:

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
   $_SERVER['HTTPS']='on';

BEFORE everything in the code.

Previously, I pasted the code above to fix admin infinite auto-loop at the end of file.

Hope it helps!!!

Upvotes: 1

Related Questions