Skip to content

Instantly share code, notes, and snippets.

@kuju63
Created November 21, 2019 15:30
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kuju63/e3b03666e7bc7a5c76ca2c5d6f2c76e4 to your computer and use it in GitHub Desktop.
Running redmine under the NGINX reverse proxy on Docker.
require ::File.expand_path('../config/environment', __FILE__)
map ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
run Rails.application
end
upstream redmine_back {
server redmine:3000;
}
server {
location /redmine/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
proxy_pass http://redmine_back/redmine/;
proxy_redirect default;
}
}
version: '3'
services:
redmine:
build:
context: ./redmine
dockerfile: Dockerfile
environment:
RAILS_RELATIVE_URL_ROOT: '/redmine'
web-proxy:
image: nginx:1.17-alpine
volumes:
- ./web-proxy/default.conf:/etc/nginx/conf.d/default.conf
links:
- redmine
ports:
- 80:80
FROM redmine:4.0.5-alpine
COPY --chown=redmine:redmine config.ru config.ru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment