I am strying to set httpS on my Strapi production but it is very difficult. I followed the tutorial written by derrickmehaffy, but it does not work for me. :'(
My pm2 service: pm2 configuration
My /etc/nginx/conf.d/upstream.conf file :
# Strapi upstream server
upstream strapi-gatsby {
server localhost:1337;
}
My /etc/nginx/sites-available/strapi.live-for-good.org.conf file :
server {
# Listen HTTP
listen 80;
server_name strapi.live-for-good.org;
# Define LE Location
location ~ ^/.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/html;
}
# Else Redirect to HTTPS // API
# location / {
# return 301 https://$host$request_uri;
# }
}
I cleared the default package in sites-available and sites-enabled, made the link, and when I wanted to check it with service nginx configtest, it fails
But, when I launch sudo nginx -t && sudo service nginx reload, I got this :
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Node.js version: 12.16.1
NPM version: 6.13.4
Strapi version: 3.0.0-beta.19.3
Database: mongoDB on MLab
Operating system: ubuntu 18.04