Is anyone here interested in helping me figure out...
# support-questions
d
Is anyone here interested in helping me figure out adding ssl to my supertokens server? I'm trying to use the superTokens docs
so far I have these operations down. The nginx just keeps restarting?
r
Which recipe are you using? I can like to the right docs
d
I don't know about a recipie.
d
#### Setting up the ssl - Find a docker nginx image here like 1.21.6-alpine: -
https://hub.docker.com/_/nginx
- Find and remember the internal bridge ip of the supertokens docker (to be used later) -
docker exec mysql1 cat /etc/hosts
- Should be something like 172.17.0.3 - Line up a nginx.conf file in the host that can be fed into the nginx docker container -
cd ; mkdir docker ; mkdir docker/nginx ; nano ~/docker/nginx/nginx.conf
- Write into that file the following (note the filled in bridge ip from the supertokens found above) -
Copy code
server {
        listen 80;
        server_name localhost;
        location / {
          proxy_pass http://localhost:3567;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
        }
      }
- Pull and start a new docker image -
Copy code
docker run --restart always --name nginx-1 -v /root/docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -p 80:80 -d nginx:1.21.6-alpine
NOW: trying to get the right nginx.conf while reading here: https://supertokens.com/docs/emailpassword/common-customizations/core/add-ssl-via-nginx PROBLEM: Nginx just keeps restarting
I'll read through your link
r
The link I shared is the same one
What do the nginx logs say?
d
I don't know how to find them. I think it has something to do with the file that I'm mounting though.
r
So you are running nginx via docker right?
d
yes
I have a ST docker + mysql docker + nginx docker attempt going on
r
You can use the command “docker logs ” to see the logs
d
I'll check. I just confirmed that if I remove the file mount then it works. I think there is a problem finding the nginx.conf dir in the docker to mount the file over. my docker is 1.21.6-alpine. So I think the confi location is strange. I'd use any nginx version though.
I'll check the logs now on the broken setup.
Hmm, Ya the file setup is weird. I'm new to nginx so I think it's just off by a bit. Says "Server directive not allowed here" . I think that has to do with that file setup.
r
Yeaa. I’m not too familiar with nginx right of the bat either. Probably google would help.
Otherwise on Monday I can have a look in more detail 🙂
d
Cool Thanks. I'm going to try to shell into the container and see where those files are and what their default setup is. Maybe I can figure out the right mounting setup. I'm trying to use the mounting setup from the "complexe config" section here: https://hub.docker.com/_/nginx
And I think I'm mixing with you guys suggested config files here and it's not perfectly compatible: https://supertokens.com/docs/emailpassword/common-customizations/core/add-ssl-via-nginx
r
Hmmmm. I see
d
I have been trying to sync those two methods up. I'll report back if I figure it out.
Thanks man.
The logs help
r
Great!
4 Views