Show More
@@ -477,27 +477,36 b' Nginx virtual host example' | |||||
477 |
|
477 | |||
478 | Sample config for nginx using proxy:: |
|
478 | Sample config for nginx using proxy:: | |
479 |
|
479 | |||
|
480 | upstream rc { | |||
|
481 | server 127.0.0.1:5000; | |||
|
482 | # add more instances for load balancing | |||
|
483 | #server 127.0.0.1:5001; | |||
|
484 | #server 127.0.0.1:5002; | |||
|
485 | } | |||
|
486 | ||||
480 | server { |
|
487 | server { | |
481 |
|
|
488 | listen 80; | |
482 | server_name hg.myserver.com; |
|
489 | server_name hg.myserver.com; | |
483 | access_log /var/log/nginx/rhodecode.access.log; |
|
490 | access_log /var/log/nginx/rhodecode.access.log; | |
484 | error_log /var/log/nginx/rhodecode.error.log; |
|
491 | error_log /var/log/nginx/rhodecode.error.log; | |
|
492 | ||||
485 | location / { |
|
493 | location / { | |
486 | root /var/www/rhodecode/rhodecode/public/; |
|
494 | try_files $uri @rhode; | |
487 | if (!-f $request_filename){ |
|
|||
488 | proxy_pass http://127.0.0.1:5000; |
|
|||
489 | } |
|
|||
490 | #this is important if you want to use https !!! |
|
|||
491 | proxy_set_header X-Url-Scheme $scheme; |
|
|||
492 | include /etc/nginx/proxy.conf; |
|
|||
493 | } |
|
495 | } | |
|
496 | ||||
|
497 | location @rhode { | |||
|
498 | proxy_pass http://rc; | |||
|
499 | include /etc/nginx/proxy.conf; | |||
|
500 | } | |||
|
501 | ||||
494 | } |
|
502 | } | |
495 |
|
503 | |||
496 | Here's the proxy.conf. It's tuned so it will not timeout on long |
|
504 | Here's the proxy.conf. It's tuned so it will not timeout on long | |
497 | pushes or large pushes:: |
|
505 | pushes or large pushes:: | |
498 |
|
506 | |||
499 | proxy_redirect off; |
|
507 | proxy_redirect off; | |
500 | proxy_set_header Host $host; |
|
508 | proxy_set_header Host $host; | |
|
509 | proxy_set_header X-Url-Scheme $scheme; | |||
501 | proxy_set_header X-Host $http_host; |
|
510 | proxy_set_header X-Host $http_host; | |
502 | proxy_set_header X-Real-IP $remote_addr; |
|
511 | proxy_set_header X-Real-IP $remote_addr; | |
503 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
512 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
General Comments 0
You need to be logged in to leave comments.
Login now