1
apache問題。一定是簡單的,但我失敗了。基於子路徑的反向代理服務器
我試圖配置Apache作爲反向代理到它後面的兩臺服務器。棘手的部分是註冊代理規則的唯一區別是子路徑。
我的想法是:
mydomain.com -> localhost:8083
mydomain.com/api -> localhost:8080/api
目前我的配置是這樣的:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName mydomain.com
ServerAlias www.mydomain.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass/http://localhost:8083/
ProxyPassReverse/http://localhost:8083/
ProxyPass /api http://localhost:8080/api #already tried with slashes on both first and second parameters
ProxyPassReverse /api http://localhost:8080/api #already tried with slashes on both first and second parameters
</VirtualHost>
但/ API無法正常工作,它不斷將請求發送到8083.爲什麼任何想法?
感謝關注
你說得對。非常感謝! –
很高興工作:) – obscurite