简体   繁体   中英

Ghost blog proxied with .htaccess (does work in dev env, not in prod env)

I am running two instances of ghost blogs on my server with one instance on port xxxxx and the second on port yyyyy. I use following .htaccess configuration to force SSL on all requests and proxy the myserver.com requests to port xxxxx and the rest to port yyyyy.

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_NAME} myserver.com
RewriteRule (.*) http://localhost:xxxxx/$1 [P]
RewriteRule (.*) http://localhost:yyyyy/$1 [P]

It works fine, as long as i run the blog in development environment, but if i run it in production i just find a new empty ghost blog instead of the blog i populated. I know it is not necessary to run it in production, but that it improves performance.

Could you point me to the difference in development to production environment when running ghost blogs that triggers that behaviour?

Ghost use different database file between production and development. If you use the default config.js , then the database file will be located at <ghost root>/content/data/ .

You will find 2 .db files in the directory:

  • ghost.db for production.
  • ghost-dev.db for development.

If you already put information in development and want them in production, you can copy ghost-dev.db over ghost.db . Then start Ghost in production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM