User guide suggests sub-optimal nginx configuration

Issue #305 resolved
tobia created an issue


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;

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

location / {
    try_files $uri @rhode;

location @rhode {
    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.


// //////

Comments (1)

  1. Marcin Kuzminski repo owner

    Thanks for that. Infact it works only from 0.7 version of nginx, but i think i can safely assume older ones are obsolete. I update beta docs example nginx config.

  2. Log in to comment