C
C
codemix2015-11-22 18:39:08
JavaScript
codemix, 2015-11-22 18:39:08

Why install nginx for ghost blog?

Configured in Ghost config.js server host: 0.0.0.0 port: 80 and everything starts on the domain.

// # 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://codemix.ru/',
        mail: {},
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },

        server: {
            host: '0.0.0.0',
            port: '80'
        }
    },

    // ### 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: 'http://localhost:2368',

        // Example mail config
        // Visit http://support.ghost.org/mail for instructions
        // ```
        //  mail: {
        //      transport: 'SMTP',
        //      options: {
        //          service: 'Mailgun',
        //          auth: {
        //              user: '', // mailgun username
        //              pass: ''  // mailgun password
        //          }
        //      }
        //  },
        // ```

        // #### Database
        // Ghost supports sqlite3 (default), MySQL & PostgreSQL
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost-dev.db')
            },
            debug: false
        },
        // #### Server
        // Can be host & port (default), or socket
        server: {
            // Host to be passed to node's `net.Server#listen()`
            host: '0.0.0.0',
            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
            port: '80'
        },
        // #### Paths
        // Specify where your content directory lives
        paths: {
            contentPath: path.join(__dirname, '/content/')
        }
    },

I can't figure out why install ngnix if ghost is running?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2015-11-22
@nirvimel

  1. Nginx must serve static resources. Distributing static on a script in production is not correct.
    But if you have a localhost exclusively for development, then you generally do not need Nginx.

D
Dmitry Snytkin, 2015-11-22
@dima11221122

nginx allows you to do all sorts of goodies, such as caching, balancing. In addition, your service does not always work on port 80) There is an interesting article about cases on how you can use it. In the simplest cases, you can do without it (after all, your home router somehow manages without it)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question