我在運行Apache + Subversion和後面Nginx上代理SSL的問題,我希望有人可能有答案。我搜索谷歌幾個小時尋找我的問題的答案,似乎無法弄清楚。我看到的是當嘗試使用subversion進行MOVE或COPY時出現的「502(Bad Gateway)」錯誤;然而,結賬和提交工作正常。以下是相關部分的(我認爲)nginx的和Apache的配置文件中的問題:502網關錯誤nginx的+ APACHE +顛覆+ SSL(SVN COPY)
Nginx的
upstream subversion_hosts {
server 127.0.0.1:80;
}
server {
listen x.x.x.x:80;
server_name hostname;
access_log /srv/log/nginx/http.access_log main;
error_log /srv/log/nginx/http.error_log info;
# redirect all requests to https
rewrite ^/(.*)$ https://hostname/$1 redirect;
}
# HTTPS server
server {
listen x.x.x.x:443;
server_name hostname;
passenger_enabled on;
root /path/to/rails/root;
access_log /srv/log/nginx/ssl.access_log main;
error_log /srv/log/nginx/ssl.error_log info;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
add_header Front-End-Https on;
location /svn {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
set $fixed_destination $http_destination;
if ($http_destination ~* ^https(.*)$)
{
set $fixed_destination http$1;
}
proxy_set_header Destination $fixed_destination;
proxy_pass http://subversion_hosts;
}
}
阿帕奇
Listen 127.0.0.1:80
<VirtualHost *:80>
# in order to support COPY and MOVE, etc - over https (443),
# ServerName _must_ be the same as the nginx servername
# http://trac.edgewall.org/wiki/TracNginxRecipe
ServerName hostname
UseCanonicalName on
<Location /svn>
DAV svn
SVNParentPath "/srv/svn"
Order deny,allow
Deny from all
Satisfy any
# Some config omitted ...
</Location>
ErrorLog /var/log/apache2/subversion_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/subversion_access.log combined
</VirtualHost>
從什麼,同時研究我可以告訴這個問題,服務器名稱必須在apache服務器上以及我所做的nginx服務器上匹配。此外,即使我將配置更改爲僅使用http,該問題似乎仍然存在。
我曾試圖在過去,但想通它再次值得一試。不幸的是,對我來說,這並沒有辦法。 – 2010-03-26 13:42:22
我不得不運行'sudo a2enmod headers',那麼它工作得很好! – 2014-01-28 16:33:38
我增加了這條線,但它不適用多年。今天我刪除了這一行,它現在可以工作 – marstone 2016-05-26 02:11:08