简体   繁体   中英

Wordpress configuration causing plugin page to return 403 http status

I've set up a bitnami powered wordpress server on AWS and migrated an existing wordpress site to the new instance.

When accessing plugins through the wordpress admin, I encounter the message "Sorry, you are not allowed to access this page." and the server returns a 403 http code.

An example of the URL that I see the error on is: https://stg.mydomain.com/wp-admin/admin.php?page=instapage_dashboard

When accessing the plugin pages through my ec2 public DNS domain there is no issue.

I am proxying to the ec2 domain from the mydomain server with nginx:

location /wp-admin {
  rewrite ^/wp-admin/(.*)$ /$1 break;
  resolver 8.8.8.8;
  proxy_set_header X-Real-IP  $remote_addr;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header Host $host;
  proxy_pass http://ec2-ipaddress.compute-1.amazonaws.com$request_uri$is_args$args;
  proxy_redirect off;
}

On the ec2 server I am running apache rather than nginx. Is there some kind of cookie or header I might not have access to in the wordpress admin when accessing from mydomain rather than the ec2 domain?

Bitnami Engineer here.

If you can access the application using the public domain name that AWS gives you and you can't access it using your own domain, it could be an issue with the configuration of the application.

In your case, you will need to configure WordPress to use your domain instead of using the AWS public domain. You can set your domain in the WP_SITEURL and WP_HOME variables of the wp-config.php file of WordPress.

https://docs.bitnami.com/aws/apps/wordpress/#how-to-change-the-wordpress-domain-name

You can also set the domain of WordPress by using our configuration tool:

sudo /opt/bitnami/apps/wordpress/bnconfig --machine_hostname NEW_DOMAIN

and then disable it to not to update the domain during the next boot of the machine

sudo mv /opt/bitnami/apps/wordpress/bnconfig /opt/bitnami/apps/wordpress/bnconfig.disabled

https://docs.bitnami.com/aws/apps/wordpress/#updating-the-ip-address-or-hostname

Another reason of this failure could be an issue with the plugins, have you tried to disable all the plugins and enable them one by one to check what the problematic one is?

The last reason could be a cookies issue in your browser, have you tried to access the application using an incognito window in your browser?

I hope all this information helps.

Jota

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM