Content

URL Prefix (sub-uri) server configuration

Introduction

In most cases, Easy Redmine is run on a subdomain (e.g. https://redmine.mycompany.com). This is the most stable way.

However, due to internal policies, some companies run it on a sub-uri (e.g. https://mycompany.com/redmine). If this is your case, you need to be extra careful about the server configuration. Here are our tips for correct functioning.

Using incorrect configuration may result in problems with some functions. Most notably: Exports, Javascript components like Gantt or WBS, modal windows and others.

This guidline is based on original Redmine (http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI#Using-RedmineUtils-preferred-solution)

The sample configuration is for application https://prefix.easyredmine.com/redmine

Setup puma

For puma you need to edit 2 files - config.ru and config/environment.rb

config.ru -> add map for "/redmine" around current run application
map  '/redmine' do
  run RedmineApp::Application
end
config/environment.rb -> append this line to end of file
Redmine::Utils::relative_url_root = "/redmine"

Nginx

Update root, add location for "/redmine" and create aliases. Example:

upstream prefix.easyredmine.com {
  server                      unix:///home/easyproject/prefix.easyredmine.com/application.sock;
}

server {

  listen                      443 ssl http2;
  server_name                 prefix.easyredmine.com;
#  root                        /home/easyproject/prefix.easyredmine.com/public_html/public;
  root                        /home/easyproject/prefix.easyredmine.com/redmine;



  access_log                  /var/log/nginx/prefix.easyredmine.com.log;
  error_log                   /var/log/nginx/prefix.easyredmine.com.err;


location /redmine {
#    root                        /home/easyproject/prefix.easyredmine.com/public_html/public;
    alias                        /home/easyproject/prefix.easyredmine.com/redmine;
    proxy_pass                http://prefix.easyredmine.com;
    include default.d/upstream.conf;
  }

  location /cable {
    proxy_pass                http://prefix.easyredmine.com;
    include default.d/websocket.conf;
  }

location ~ ^/redmine/(images|system|assets|plugin_assets)/ {
    alias                        /home/easyproject/prefix.easyredmine.com/redmine;
    proxy_pass                http://prefix.easyredmine.com;

    gzip_static               on;
    expires                   3M;
    add_header                Cache-Control public;
    add_header                ETag '';
    break;
}

  ssl_certificate             /etc/nginx/ssl/easyredmine_com.crt;
  ssl_certificate_key         /etc/nginx/ssl/easyredmine_com.key;

}

Apache2

    <Directory /path/to/redmine/>                
            RailsBaseURI /redmine
            PassengerResolveSymlinksInDocumentRoot on
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

Don't forget!

In the application settings, enter the full URL.

Administration >> Settings >> General - Host name and path

Image20190227155216_1.png

Easy Redmine 2019 Free Trial

Full-featured, 30 Days, SSL protected, Daily Backups, In your Geo Location

or