Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Docker-compose behind NGINX Reverse Proxy

Docker-compose behind NGINX Reverse Proxy

Added by Luigi Maiorano about 2 years ago

Hi All,

I've been banging my head against the wall for two days now, and feel like I've tried every variation of configuration that I could think of or came across in the forums. I'm still a novice at networking, but feel like I have a basic understanding of how the reverse proxy should work. Let my explain..

What I'm trying to achieve:

  • Nginx Reverse Proxy handling SSL (on host A, 10.10.20.3)
  • OpenProject in a Proxmox LXC container (on host B, 10.10.20.11)
  • Both machines A and B are in the same VLAN

What works:

  • Accessing OpenProject directly via 10.10.20.11:8080 via the browser 
    • OPENPROJECT_HTTPS=false
    • Default docker-compose config

What doesn't work:

  • Accessing OpenProject via the reverse proxy
    • With all combinations of
      • OPENPROJECT_HTTPS=true/false
      • docker-compose proxy service enabled/disabled (explained here)
  • Connecting to OpenProject from the ReverseProxy host via telnet 10.10.20.11 8080
    • From my pc the connection via telnet does work

The Nginx Reverse Proxy config:

server {
    listen                               443 ssl http2;
    listen                               [::]:443 ssl http2;
    server_name                          op.domainname.org;

    # SSL
    ssl_certificate                      /etc/letsencrypt/live/domainname.org/fullchain.pem;
    ssl_certificate_key                  /etc/letsencrypt/live/domainname.org/privkey.pem;
    ssl_trusted_certificate              /etc/letsencrypt/live/domainname.org/chain.pem;


    # reverse proxy
    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass "http://10.10.20.11:8080";
    }


    # Access Log
    access_log  /var/log/nginx/op.access.log;

    error_log /var/log/nginx/op.error.log debug;
}


# HTTP redirect
server {
    listen      80;
    listen      [::]:80;
    server_name op.domainname.org;
    include     nginxconfig.io/letsencrypt.conf;

    location / {
        return 301 https://op.domainname.org$request_uri;
    }
}

I've tried many, many variations on this configuration, but this is the most recurring example I could find. None have worked. Maybe worth noting is that I also have other webservers on this vlan, which are successfully served by this reverse proxy.

Something suspicious is when I try to debug traffic using the OPNsense firewall logs. I see for all connections between the ReverseProxy and the OpenProject host (so both telnet and when connecting via the FQDN url), it's blocked by  Default deny / state violation rule. Unfortunately, my understanding is that there is not a single fix for this as it can be caused by many things.

I'm at complete loss how to best continue or effectively debug this. I think my topmost burning question is:

  • What combination of docker-compose overrides and environment variables should I use, and with which nginx configuration?

If someone has a working example or at least some ideas, PLEASE chime in.

Thanks,

Luigi


Replies (1)

RE: Docker-compose behind NGINX Reverse Proxy - Added by Office netMedia about 2 years ago

i have a similar problem see (https://community.openproject.org/topics/16588) but in my case the reason seems to be the database connection. 

do you use the docker-compose version as well? maybe you can bridge your vlan to a docker network and add

networks:
  ...
  nginx_proxy:
    external: true
    
service:
  ...
  web:
    networks:
      ...
      - nginx_proxy
  ...

or use network_mode: host so the docker container can access your vlan

  • (1 - 1/1)
Loading...