最近我因为Apache的HTTP服务器和WildFly上运行的项目。我对这些技术很陌生。我在Apache端有一个代理配置问题。这是我的Apache的httpd.conf VirtualHosts配置。Apatche HTTP服务器 - 如何设置代理WildFly
#frontend
<VirtualHost *:80>
<Location />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Location>
ServerName adminapp.pl
DocumentRoot "D:\Projects\RS_front\adminapp"
ErrorLog "d:\logs\httpd\admin_error.log"
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(/index\.html|/img|/js|/css|/assets|/robots\.txt|/favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</VirtualHost>
#backend proxy
<VirtualHost *:80>
<Location />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Location>
ServerName api.adminapp.pl
ErrorLog "d:\logs\httpd\wildflyProxy.log"
CustomLog "d:\logs\httpd\wildflyProxy_custom.log" combined
ForensicLog "d:\logs\httpd\wildflyProxy_forensic.log"
DumpIOInput On
DumpIOOutput On
LogLevel Debug
ProxyRequests Off
ProxyPreserveHost On
#adres aplikacji and serwerze Wildfly
ProxyPass "/" "http://localhost:8080/adminapp/" timeout=600
ProxyPassReverse "/" "http://localhost:8080/adminapp/" timeout=600
ProxyPassReverseCookiePath "/adminapp" "/"
Header add Access-Control-Allow-Origin: adminapp.pl
Header add Access-Control-Allow-Headers "X-Requested-With,Content-Type,Authorization,Accept,Content-Disposition"
Header add Access-Control-Allow-Methods "GET,PUT,POST,DELETE,PATCH,OPTIONS"
</VirtualHost>
我尝试通过adminapp登录到系统,但它不起作用。我完全失去了这一点,因为我无法跟踪任何错误或日志,告诉我这个配置有什么问题。
这是我跟踪到目前为止(地址adminapp.pl & api.adminapp.pl映射在我的主机到本地主机文件):
,应该在登录尝试的样子叫的网址这http://localhost:8080/adminapp/oauth/token。当我在浏览器中输入此网址时,我收到了来自WildFly服务器的响应,我提供了错误的登录凭据和WildFly服务器日志异常。
当我在浏览器中键入URL http://api.adminapp.pl/oauth/token我从服务器获取相同respons。所以它看起来像代理的作品。
当我试图通过adminapp.pl登录,提供不正确的凭据才达到同样的错误,没有任何反应。我只在Apache访问日志“POST /api.adminapp.pl/oauth/token HTTP/1.1”200 906“中获得此行。
当我配置前--addapp.pl直接连接到http://localhost:8080/adminapp(NO PROXY ),然后WildFly服务器记录错误凭据错误,但前面还有其他问题“XMLHttpRequest无法加载http://localhost:8080/adminapp/oauth/token。请求的资源上没有“Access-Control-Allow-Origin”标题。因此,原产地“http://localhost”是不允许访问。“我想这是所以我需要代理在我的配置造成的CORS。
你可以从我的配置看,我试图产生尽可能多的日志,因为我可以,但我无法找到更多有用的信息,似乎Apache将内存中的日志缓存并将它们转储到文件的时间间隔内?有没有办法告诉Apache一旦收到信息就记录信息?
总结我需要设置这个代理,不知道如何进一步解决我的问题。能否请您指点我,我能怎么办呢?
个问候