在ubuntu 18 上安裝了apache2+svn+svnadmin +nginx 採用nginx https轉http的方式訪問svn 在客戶端建立分支時,提示錯誤:Unexpected HTTP status 502 'Bad Gateway' on .... 查找網絡上的方法,採用如下步驟解決: 1、在apache2的配置目錄下找到000-default.conf,(也就是<VirtualHost > 所在的文件) 增加一行:RequestHeader edit Destination ^https http early
<VirtualHost *:82>
# 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.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RequestHeader edit Destination ^https http early
</VirtualHost>
保存後重新啓動apache2 :# service apache2 restart 結果啓動apache2 失敗,查看日誌報:Invalid command 'RequestHeader', perhaps misspelled or defined by a module 於是在網上一番查找,最終執行第二步問題解決。
2、執行下面命令來開啓header:
# sudo a2enmod headers
# service apache2 restart
重新啓動apache2 成功後,svn新建分支成功!