1
usernametoolong 2015-08-06 16:48:38 +08:00
proxy_pass http://localhost:90;
应该是这样写 |
2
raycloud OP |
3
xiaobu 2015-08-06 17:00:47 +08:00
|
4
Ellison 2015-08-06 17:05:02 +08:00
|
5
dallaslu 2015-08-06 17:07:22 +08:00 1
svn 应该是整合在 apache 里了吧?我也遇到过类似的问题,通过 nginx 反代时子目录不好处理。所以我在 apache 中单独为 svn 创建了一个虚拟主机。然后,nginx 配置如下:
```conf #... server_name svn.honeyhaw.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/svn.honeyhaw.com; ssl on; ssl_certificate conf.d/certs/startssl_svn_honeyhaw.com.crt; ssl_certificate_key conf.d/certs/honeyhaw.com.key; include conf.d/templates/security.conf; include conf.d/templates/ssl-security.conf; location ^~ /{ proxy_set_header Destination $http_destination; #proxy_pass https://192.168.183.70; proxy_pass https://127.0.0.1:443; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #... ``` |
7
ryd994 2015-08-06 18:24:05 +08:00 via Android 1
proxy_pass http://127.0.0.1:90/svn/;
注意最后的/ 如果不行的话再试试: proxy_pass scheme://127.0.0.1:90/svn$uri; 再不行的话 rewrite ^(.*)$ /svn$1 last; proxy_pass 127.0.0.1:90; 凭记忆写的,未测试,请务必反馈结果 |
8
ryd994 2015-08-06 18:25:13 +08:00 via Android
纠正,第二条
proxy_pass $scheme://127.0.0.1:90/svn$uri; 或者 proxy_pass http://127.0.0.1:90/svn$uri; |
9
raycloud OP @ryd994 第1、2条在浏览器里访问正常,奇怪的是用TortoiseSVN和eclipse会出现:找不到路径 "/repo/!svn/vcc/default" , 第3条 500 Internal Server Error
|
10
zonghua 2015-08-06 19:14:09 +08:00 via iPhone
@xiaobu 我只想问问怎么配置主站只用顶级域名访问,不带www。我按照example.com的域名配置还是要www才能访问
|
11
raycloud OP @zonghua 试试这个
server { listen 80; server_name www.example.com; return 301 http://example.com$request_uri; } |
12
br00k 2015-08-06 19:23:18 +08:00
rewrite ^(.*)$ /svn/$1 break;
|
13
msg7086 2015-08-06 21:43:49 +08:00
解决问题的重点在于
先把/XXX改写成/svn/XXX,然后再做proxy_pass。(当然一边proxy一边改地址也不是不行啦。 |
15
ETiV 2015-08-06 22:04:23 +08:00 via iPhone
nginx 不是不支持WebDAV吗……我一直是这么记得的
|
17
raycloud OP @ryd994 在浏览器里正常,能正常列出目录与文件,但在eclipse里报错:
svn: '/repositories/!svn/vcc/default' path not found |
18
xiaobu 2015-08-07 08:42:37 +08:00
@zonghua 设置下301强制跳转到顶级域名就可以了,server段加入
if ($host != "domain.com" ) { rewrite ^/(.*)$ http://domain.com/$1 permanent; } |