Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have SVN, TRAC and Web server installed in my server. SVN and TRAC services are configured on Apache, listening 81 port, http://localhost:81/svn (with basic http auth) and http://localhost:81/trac.

Web server is NGINX, listening 80 port.

I would like to configure nginx to allow access to SVN and TRAC using http://localhost/svn and http://localhost/trac.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Between "server {" and "}" in your configuration file:

location /svn {
        proxy_pass         http://127.0.0.1:81/svn;
        proxy_redirect     off;

        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_max_temp_file_size 0;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;

        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;

        proxy_pass_request_headers on;
        proxy_no_cache $cookie_nocache  $arg_nocache $arg_comment;
        proxy_no_cache $http_pragma     $http_authorization;
        proxy_set_header HTTP_AUTHORIZATION $http_authorization;
 }


location /trac {
        proxy_pass         http://127.0.0.1:81/trac;
        proxy_redirect     off;

        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_max_temp_file_size 0;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
 }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.