简体   繁体   English

Wordpress配置导致插件页面返回403 http状态

[英]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. 我已经在AWS上设置了由bitnami驱动的wordpress服务器,并将现有的wordpress网站迁移到了新实例。

When accessing plugins through the wordpress admin, I encounter the message "Sorry, you are not allowed to access this page." 通过wordpress管理员访问插件时,出现消息“对不起,不允许您访问此页面”。 and the server returns a 403 http code. 服务器返回403 http代码。

An example of the URL that I see the error on is: https://stg.mydomain.com/wp-admin/admin.php?page=instapage_dashboard 我看到该错误的URL的示例是: 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. 通过我的ec2公共DNS域访问插件页面时,没有问题。

I am proxying to the ec2 domain from the mydomain server with nginx: 我正在使用Nginx从mydomain服务器代理到ec2域:

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. 在ec2服务器上,我正在运行apache而不是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? 从mydomain而非ec2域访问时,在wordpress admin中可能没有某种cookie或标头吗?

Bitnami Engineer here. Bitnami工程师在这里。

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. 如果您可以使用AWS为您提供的公共域名来访问应用程序,而不能使用自己的域来访问它,则可能是应用程序配置出现问题。

In your case, you will need to configure WordPress to use your domain instead of using the AWS public domain. 在您的情况下,您将需要配置WordPress以使用您的域而不是使用AWS公共域。 You can set your domain in the WP_SITEURL and WP_HOME variables of the wp-config.php file of WordPress. 您可以在WordPress的wp-config.php文件的WP_SITEURL和WP_HOME变量中设置域。

https://docs.bitnami.com/aws/apps/wordpress/#how-to-change-the-wordpress-domain-name 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: 您还可以使用我们的配置工具来设置WordPress的域:

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 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? 最后一个原因可能是浏览器中的cookie问题,您是否尝试使用浏览器中的隐身窗口访问该应用程序?

I hope all this information helps. 希望所有这些信息对您有所帮助。

Jota 霍塔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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