Project

General

Profile

Actions

Task #3563

closed

Check if proxy-prefix middleware works also now OOTB wih pyramid

Added by Marcin Kuzminski [CTO] over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
25.04.2016
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:

Description

We have a special config called proxy-prefix. That allows people to specify a prefix that RC runs under.

## prefix middleware for RhodeCode, disables force_https flag.
## allows to set RhodeCode under a prefix in server.
## eg https://server.com/<prefix>. Enable `filter-with =` option below as well.
#[filter:proxy-prefix]
#use = egg:PasteDeploy#prefix
#prefix = /<your-prefix>

[app:main]
use = egg:rhodecode-enterprise-ce
## enable proxy prefix middleware, defined below
#filter-with = proxy-prefix

We should verify it works now with pyramid. This is tricky part since it influences how routes are generated.

Actions #1

Updated by Johannes Bornhold over 8 years ago

  • Target version set to v4.1

It is important to check for Pyramid views and Pylons views that it works as expected.

Actions #2

Updated by Johannes Bornhold over 8 years ago

  • Status changed from New to In Progress
  • Assignee set to Johannes Bornhold
Actions #3

Updated by Johannes Bornhold over 8 years ago

  • Status changed from In Progress to Resolved

Did a quick check by setting up a local nginx server whichs serves the application at http://localhost:8081/myrcprefix/
Everything seems to work fine, links are generated with the myrcprefix prefix.

Used this command to start the application:

pserve prefix.ini

Used this nginx configuration:

upstream rhodecode-enterprise {
    server 127.0.0.1:5000;
}

server {
    listen 8081;
    server_name  example.com;
    access_log  /Users/johbo/var/logs/nginx/access.log;

    location /myrcprefix/ {
        proxy_set_header        Host $http_host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;

        client_max_body_size    10m;
        client_body_buffer_size 128k;
        proxy_connect_timeout   60s;
        proxy_send_timeout      90s;
        proxy_read_timeout      90s;
        proxy_buffering         off;
        proxy_temp_file_write_size 64k;
        proxy_pass http://rhodecode-enterprise;
        proxy_redirect          off;
    }
}

Snippet of application ini file:

[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /myrcprefix/

[app:main]
use = egg:rhodecode-enterprise-ce
## enable proxy prefix middleware, defined below
filter-with = proxy-prefix
Actions #4

Updated by Johannes Bornhold over 8 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF