我已经设置了一个带有apache的反向代理,并指向我本地网络上的其他4个apache wordpress服务器vm。
当我访问其中3个网站时(例如www.mywebsite.com,从工作中的计算机外部),他们解决得很好,网站正确生成页面。
当我尝试连接到第4个站点时,它会将我重定向到192地址,这是我在代理配置中所拥有的,但它没有像其他站点那样正确解析。我确实复制并粘贴了000-default.conf中的每个块,所以我知道它们是相同的。
代理工作正在移动流量,但会尝试在本地解析。这是我的000-default.conf中的块。
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName www.mywebsite.com
ServerAdmin myemail@gmail.com
DocumentRoot /var/www/html
ProxyPass / http://192.168.1.23:80/
ProxyPassReverse / http://192.168.1.23:80/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
我不确定网站之间有什么不同。我做了很多次,从来没有遇到过这个问题。这可能是第4个网站上的Web服务器的问题吗?这些都是VM运行带灯的ubuntu服务器。
答案 0 :(得分:0)
看起来这是第4台服务器的问题以及如何使用wordpress处理索引文件。似乎必须首先在本地配置Wordpress。但是,我不记得与其他网站这样做。一切都很好。