Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for external nginx instance #290

Open
spaceboots23 opened this issue Sep 6, 2024 · 2 comments
Open

No support for external nginx instance #290

spaceboots23 opened this issue Sep 6, 2024 · 2 comments

Comments

@spaceboots23
Copy link

It's great that there is a well built mechanism for running a stand-alone instance of sharelatex, but for those wanting to spin it up in a docker container and use an existing nginx reverse-proxy setup (such as one would want to do on a home server), this is a real pain in the neck. What should be a 5 minute job is basically impossible.

@ThexXTURBOXx
Copy link

It's not impossible and I was basically able to set it up in 5 minutes.
Just use a setup similar to this and make sure the ports match:

server {
    server_name overleaf.example.com;
    location / {
        proxy_pass https://localhost:444/;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 10m;
        proxy_send_timeout 10m;
    }

    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";

    server_tokens off;

    client_max_body_size 50M;

    # I am using Certbot, so it automatically added these.
    # You don't need to use it - but it works quite well for me.
    listen 443 ssl; # managed by Certbot
    ssl_certificate /path/to/fullchain.pem; # managed by Certbot
    ssl_certificate_key /path/to/privkey.pem; # managed by Certbot
    include /path/to/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /path/to/ssl-dhparams.pem; # managed by Certbot
}

@FifoF
Copy link

FifoF commented Oct 11, 2024

Impossible, you say? I have a working Overleaf setup going through an external nginx reverse proxy. Here’s how:

overleaf.rc:

OVERLEAF_PORT=8888

variables.env:

OVERLEAF_BEHIND_PROXY=true
OVERLEAF_SITE_URL=https://overleaf.example.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants