如何使用 nginx+php-fpm 设置 SVN?
我有一个 Nginx 和 PHP-FPM 的工作安装,其默认索引目录是 /usr/share/nginx/html/
另外,我有一个 SVN 的工作安装,它的默认目录似乎是 /var/www/
我尝试更改 nginx.conf 中的默认路径以指向 /var/www/html 但它不起作用:
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
##** I tried to change the line above to /var/www/html/**
include fastcgi_params;
nginx.conf 中到底需要更改什么?或者也许我可以将 svn 默认目录更改为 /usr/share/nginx/html ?我怎样才能做这两件事?
I have a working installation of Nginx and PHP-FPM, which its default index directory is /usr/share/nginx/html/
Also, I have a working installation of SVN, it seems the default directory of this is /var/www/
I tried to change in nginx.conf the default path to point to /var/www/html but it didn't worked:
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
##** I tried to change the line above to /var/www/html/**
include fastcgi_params;
What exactly need to change in nginx.conf? or maybe I can change the svn default directory to /usr/share/nginx/html ? How can I do any of both things?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望通过 nginx 提供 https 上的 svn commit 访问,我认为这是不可能的。我建议使用 nginx 反向代理 apache + mod_dav_svn 的服务器。如果您愿意,您可以将 apache 与 nginx 运行在同一台机器上。
If you wish to provide svn commit access over https through nginx, I don't believe that will be possible. What I would recommend is to have nginx reverse proxy a server with apache + mod_dav_svn. If you'd like, you could have apache live on the same machine as nginx.