docker-taiga / taiga

docker-compose.yml for simple taiga setup
215 stars 75 forks source link

Problem with SSL #21

Closed emeraldhieu closed 4 years ago

emeraldhieu commented 5 years ago

I turned on ENABLE_SSL='yes' but it didn't work. The generated linked "conf/nginx.conf" is always the non-SSL one. So I forked and rebuilt your proxy repo like this (even set a fixed "yes")


INITIAL_SETUP_LOCK=/taiga-conf/.initial_setup.lock

ENABLE_SSL='yes'
if [ "$ENABLE_SSL" = 'yes' ]; then
   echo SSL turned on!
   CONFIG_FILE=nginx_ssl.conf
else
   echo No SSL
   CONFIG_FILE=nginx.conf
fi

if [ ! -f $INITIAL_SETUP_LOCK ]; then
    touch $INITIAL_SETUP_LOCK
    sed -e 's/$TAIGA_HOST/'$TAIGA_HOST'/' \
        -e 's/$TAIGA_BACK_HOST/'$TAIGA_BACK_HOST'/' \
        -e 's/$TAIGA_FRONT_HOST/'$TAIGA_FRONT_HOST'/' \
        -e 's/$EVENTS_HOST/'$EVENTS_HOST'/' \
        -e 's/$CERT_NAME/'$CERT_NAME'/' \
        -e 's/$CERT_KEY/'$CERT_KEY'/' \
        -i /tmp/taiga-conf/$CONFIG_FILE
    cp /tmp/taiga-conf/$CONFIG_FILE /taiga-conf/nginx.conf
    ln -sf /taiga-conf/nginx.conf /etc/nginx/conf.d/nginx.conf
    cp /tmp/taiga-conf/proxy_params /taiga-conf/proxy_params
    ln -sf /taiga-conf/proxy_params /etc/nginx/proxy_params
else
    ln -sf /taiga-conf/nginx.conf /etc/nginx/conf.d/nginx.conf
    ln -sf /taiga-conf/proxy_params /etc/nginx/proxy_params
fi

exec nginx -g 'daemon off;'

I also had certificates in "cert" folder.

After docker-compose up --force-recreate -d, it shows many errors (502 Bad Gateway)

Screen Shot 2019-08-11 at 5 54 46 PM

Could you please take a look what was wrong with my configuration? Has anyone tried SSL turned on?

w1ck3dg0ph3r commented 4 years ago

Hi! The issue was in quotes around ENABLE_SSL value. It was neccessary in .yml but we forgot to remove quoting when we moved variables to .env file. Fixed in 607822c. Just use ENABLE_SSL=yes.