Question

I installed redmine with thin and nginx on my raspberry pi. I am able to access my redmine installation using http://raspberrypi/. However I want it to be http://raspberrypi/redmine.

My current (working) nginx site config looks like this:

upstream redmine {
  server unix:/var/run/thin/redmine.0.sock;
}

server {
  listen 80;
  server_name raspberrypi;
  root /usr/share/redmine/public;

  location / {
    proxy_pass http://redmine/;
  }
}

When I change the location line to location /redmine { I can access redmine using http://raspberrypi/redmine but all links are pointing to http://raspberrypi/ without "redmine" appended and are not working.

Was it helpful?

Solution

Add the following line at the bottom of your config/environment.rb

Redmine::Utils::relative_url_root = "/redmine"

Start the thin server with --prefix /redmine, in my case:

thin start --prefix "/redmine" -s1 --socket /tmp/thin.sock

Change your nginx configuration to:

location /redmine {
   proxy_pass http://redmine/redmine;
}

Also look at the documentation.

OTHER TIPS

Change the following lines at the bottom of your "/var/www/redmine/config" /environment.rb

change ::

# Initialize the Rails application
Rails.application.initialize!

to::

RedmineApp::Application.routes.default_scope = "/redmine" 
# Initialize the Rails application
Rails.application.initialize!

URL : http://adresse_ip/redmine

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top