Skip to content

HTTPS on non standard port #333

@marcorighi

Description

@marcorighi

Hi,
I fail to configure HTTP on 33443 port.

I configured overeleaf.rc as follows:

### Overleaf RC ####

PROJECT_NAME=overleaf

# Sharelatex container
# Uncomment the OVERLEAF_IMAGE_NAME variable to use a user-defined image.
# OVERLEAF_IMAGE_NAME=sharelatex/sharelatex
OVERLEAF_IMAGE_NAME=tuetenk0pp/sharelatex-full
OVERLEAF_DATA_PATH=data/overleaf
SERVER_PRO=false
OVERLEAF_LISTEN_IP=127.0.0.1
#OVERLEAF_LISTEN_IP=0.0.0.0
#OVERLEAF_PORT=80
OVERLEAF_PORT=80

#OVERLEAF_SECURE=true
#OVERLEAF_SSL_KEY_PATH=/home/xxx/overleaf-toolkit/key.pem
#OVERLEAF_SSL_CRT_PATH=/home/xxx/overleaf-toolkit/cert.pem

# Sibling Containers
SIBLING_CONTAINERS_ENABLED=true
DOCKER_SOCKET_PATH=/var/run/docker.sock

# Mongo configuration
MONGO_ENABLED=true
MONGO_DATA_PATH=data/mongo
MONGO_IMAGE=mongo
MONGO_VERSION=6.0

# Redis configuration
REDIS_ENABLED=true
REDIS_DATA_PATH=data/redis
REDIS_IMAGE=redis:6.2
REDIS_AOF_PERSISTENCE=true

# Git-bridge configuration (Server Pro only)
GIT_BRIDGE_ENABLED=false
GIT_BRIDGE_DATA_PATH=data/git-bridge

# TLS proxy configuration (optional)
# See documentation in doc/tls-proxy.md
#NGINX_ENABLED=false
NGINX_ENABLED=true
NGINX_CONFIG_PATH=config/nginx/nginx.conf
#NGINX_HTTP_PORT=80
NGINX_HTTP_PORT=33080
# Replace these IP addresses with the external IP address of your host
#NGINX_HTTP_LISTEN_IP=127.0.1.1
NGINX_HTTP_LISTEN_IP=192.168.123.16
#NGINX_TLS_LISTEN_IP=127.0.1.1
NGINX_TLS_LISTEN_IP=192.168.123.16
TLS_PRIVATE_KEY_PATH=config/nginx/certs/overleaf_key.pem
TLS_CERTIFICATE_PATH=config/nginx/certs/overleaf_certificate.pem
#TLS_PORT=443
TLS_PORT=33443

# In Air-gapped setups, skip pulling images
# PULL_BEFORE_UPGRADE=false
# SIBLING_CONTAINERS_PULL=false

and nginx.con

events {}

http {

    server {
        listen 80 default_server;
        #listen 33080 default_server;
        server_name _;
        #return 301 https://$host$request_uri;
        return 301 https://$host:33443$request_uri;
    }


    server {
        #listen 443 ssl;
        listen 33443 ssl;

        server_name 192.168.123.16 qualifiedname.domain.com internalname.lab;

        ssl_certificate      /certs/nginx_certificate.pem;
        ssl_certificate_key  /certs/nginx_key.pem;

        # Intermediate Mozilla Config
        # https://ssl-config.mozilla.org/#server=nginx&version=1.26.0&config=intermediate&openssl=1.1.1w&ocsp=false&guideline=5.7
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
        ssl_prefer_server_ciphers off;
	#ssl_prefer_server_ciphers on;

        # config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
        # to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping	
        add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";

        server_tokens off;

        client_max_body_size 50M;

        location / {
            proxy_pass http://sharelatex:80;
            #proxy_pass http://127.0.0.1:80;
            #proxy_pass http://overleaf:80;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_read_timeout 3m;
            proxy_send_timeout 3m;
        }
    }
}

Please can you help me to understand why this configuration is missworking?

obviously I initialize overleaf using bin/init --tls command.

Best Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions