1. Marcin Kuzminski
  2. RhodeCode
  3. Issues

Issues

Issue #305 resolved

User guide suggests sub-optimal nginx configuration

tobia
created an issue

Hi

The User guide* suggests a snippet of nginx configuration using the if pseudo-location to tell static files from dynamic content. But this is inefficient and discouraged.

The best way to do it, as advised by the official nginx documentation////, is with try_files:

{{{ server { listen 80; server_name hg.myserver.com;

root /usr/local/lib/python2.6/dist-packages/rhodecode/public/;

location / {
    try_files $uri @rhode;
}

location @rhode {
    proxy_pass http://127.0.0.1:5000;
    include /etc/nginx/proxy.conf;
}

} }}}

Also, the line with proxy_set_header X-Url-Scheme is best moved to the following block, that of proxy.conf.


//*// http://packages.python.org/RhodeCode/setup.html#nginx-virtual-host-example

// ////// http://wiki.nginx.org/HttpRewriteModule#if

Comments (1)

  1. Log in to comment