makeplane / plane

🔥 🔥 🔥 Open Source JIRA, Linear and Asana Alternative. Plane helps you track your issues, epics, and product roadmaps in the simplest way possible.
http://plane.so
GNU Affero General Public License v3.0
26.17k stars 1.42k forks source link

[feature]: Update documentation to detail how to put Plane behind existing Nginx proxy for Plane self-hosted #3873

Open spmp opened 4 months ago

spmp commented 4 months ago

Is there an existing issue for this?

Summary

Please provide documentation and changes (Nginx site template at least) to plane self-hosted detailing how to setup an external Nginx instance to act as reverse proxy for Plane self-hosted.

Why should this be worked on?

Plane self-hosted is so fantastically easy, providing Plane in all it's glory in a close to a single command on the NGINX_PORT. Documentation, templates, and any changes required to Plane to enable the self-hosted Plane to be integrated into an existing environment would further increase usability. For example, being able to provide Plane self-hosted on my existing FQDN or IP such as https://fqdn.blah/plane or http://192.168.1.10/plane with minimal fuss would be ideal. Additionally, providing SSL on Plane is most elegantly done via an external (to Plane self-hosted) Nginx (or other) reverse proxy which is configured to serve HTTPS content.

MVP should be:

Mai0313 commented 4 months ago

agree; because when I try to redirect by nginx, I always get 404 error image but it is working fine w/o https

spmp commented 4 months ago

agree; because when I try to redirect by nginx, I always get 404 error... but it is working fine w/o https Can you please detail what you have done. I suck at Nginx and couldn't get any of it to work. I am more than happy to test and create the documentation and templates. I cannot test with an FQDN at this time, only IP.

thefiredragon commented 4 months ago

Our config looks like:

server {
    listen              443 ssl http2;
    listen              [::]:443 ssl http2;
    server_name         plane.domain.net;

    # SSL
    ssl_certificate     /etc/certifications/domain.net/fullchain.pem;
    ssl_certificate_key /etc/certifications/domain.net/privkey.pem;

    # security
#    include             nginxconfig.io/security.conf;

    # logging
    access_log          /var/log/nginx/plane.domain.net.access.log;
    error_log           /var/log/nginx/plane.domain.net.error.log warn;

    # reverse proxy
    location / {
        proxy_pass http://10.0.0.51:80;
        include    nginxconfig.io/proxy.conf;
    }

    # additional config
    include nginxconfig.io/general.conf;
}

# subdomains redirect
server {
    listen              443 ssl http2;
    listen              [::]:443 ssl http2;
    server_name         *.plane.domain.net;

    # SSL
    ssl_certificate     /etc/certifications/domain.net/fullchain.pem;
    ssl_certificate_key /etc/certifications/domain.net/privkey.pem;
    return              301 https://plane.domain.net$request_uri;
}

# HTTP redirect
server {
    listen      80;
    listen      [::]:80;
    server_name .plane.domain.net;
    return      301 https://plane.domain.net$request_uri;
}

proxy.conf:

proxy_http_version                 1.1;
proxy_cache_bypass                 $http_upgrade;

# Proxy SSL
proxy_ssl_server_name              on;

# Proxy headers
proxy_set_header Upgrade           $http_upgrade;
proxy_set_header Connection        $connection_upgrade;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header Forwarded         $proxy_add_forwarded;
proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host  $host;
proxy_set_header X-Forwarded-Port  $server_port;

# Proxy timeouts
proxy_connect_timeout              60s;
proxy_send_timeout                 60s;
proxy_read_timeout                 60s;      

general.conf:

# favicon.ico
location = /favicon.ico {
    log_not_found off;
}

# robots.txt
location = /robots.txt {
    log_not_found off;
}

# gzip
gzip            on;
gzip_vary       on;
gzip_proxied    any;
gzip_comp_level 6;
gzip_types      text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;

We're using a template for best practice https://www.digitalocean.com/community/tools/nginx?global.app.lang=de and it's working fine