VPS + NGINX (reverse-proxy) + SSL not working

I am currently using Ubuntu 20.04 and i’ve suscribed to a VPS. On my VPS, i installed NGINX and certbot. I’ve correctly applied a SSL certificate on strapi.oaka.fr (this is the domain i use to access my strapi). But when i go on https://strapi.oaka.ft or https://strapi.oaka.fr/admin it doesn’t works, but http://strapi.oaka.fr:1337 and http://strapi.oaka.fr:1337/admin works.

Here is my /etc/nginx/sites-available/strapi.oaka.fr configuration :

server {
listen 80;
server_name strapi.oaka.fr;

return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
server_name strapi.oaka.fr;

# Certificats SSL gérés par Certbot
ssl_certificate /etc/letsencrypt/live/strapi.oaka.fr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/strapi.oaka.fr/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; # Paramètres SSL recommandés par Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;   # Paramètres Diffie-Hellman recommandés par Certbot

# Configuration du reverse-proxy
location / {
    proxy_pass http://strapi.oaka.fr:1337;
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_pass_request_headers on;
}

}

And here’s my server.js config :

module.exports = ({ env }) => ({
host: env(‘HOST’, ‘0.0.0.0’),
port: env.int(‘PORT’, 1337),
url: ‘https://strapi.oaka.fr’,
app: {
keys: env.array(‘APP_KEYS’),
},
webhooks: {
populateRelations: env.bool(‘WEBHOOKS_POPULATE_RELATIONS’, false),
},
});

Can someone tell me why it’s not working, i did fine and nothing is working as i would…

This topic has been created from a Discord post (1275847945446756421) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord