Question
Problem with SSL and Ghost
Hello!
I’ve installed SSL to my one click install Ghost droplet but I have one problem with Ghost. Whenever I try to write url: https:// to production nginx gives 502 error code. But if i write http:// everything works almost perfectly. Nginx redirect http url to https url.
How can i fix this?
Here is my config.js file:
// # Ghost Configuration
// Setup your Ghost install for various [environments](http://support.ghost.org/config/#about-environments).
// Ghost runs in `development` mode by default. Full documentation can be found at http://support.ghost.org/config/
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment.
// Configure your URL and mail settings here
production: {
url: 'http://talhaokur.net',
mail: {
from: 'no-reply@talhaokur.net',
},
database: {
client: 'mysql',
connection: {
host: 'localhost',
user: 'user',
password: 'password',
database: 'database',
charset: 'utf8'
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2368'
},
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blog's published URL.
url: '',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
mail: {
from: 'no-reply@talhaokur.net',
},
// ```
// #### Database
// Ghost supports sqlite3 (default), MySQL & PostgreSQL
database: {
client: 'mysql',
connection: {
host: 'localhost',
user: 'user',
password: 'password',
database: 'database',
charset: 'utf8'
},
debug: false
},
// #### Server
// Can be host & port (default), or socket
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
// #### Paths
// Specify where your content directory lives
paths: {
contentPath: path.join(__dirname, '/content/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host: 'localhost',
user: 'user',
password: 'password',
database: 'database',
charset: 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};
module.exports = config;
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Hi! Are you using the DigitalOcean Ghost One-Click app? If not, could you share your Nginx configuration? I just tried setting this up using the Ghost One-Click app and Let’s Encrypt, and I haven’t been able to reproduce the problem.
@asb yes I am using One-Click app. Btw I did a mistake. I did not use Let’s Encrypt but I couldn’t change labels, sorry about that. I’ve purchased a PositiveSSL certificate. And here is my ghost file under /etc/nginx/sites-enabled.