Skip to content

Instantly share code, notes, and snippets.

@hwdsl2
Last active December 28, 2016 07:16
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hwdsl2/1b1804cad601928472e7 to your computer and use it in GitHub Desktop.
Save hwdsl2/1b1804cad601928472e7 to your computer and use it in GitHub Desktop.
Ghost Blog Auto Setup Script with Nginx and ModSecurity
@hwdsl2
Copy link
Author

hwdsl2 commented Apr 29, 2014

@fratoro Unfortunately uploading media files (e.g. the blog cover) is an issue for which I have not yet found a solution. It is certainly a problem with ModSecurity but I am not sure which rule is causing that.

For now you can try logging into Ghost admin via SSH port forwarding (at port 2368) in order to upload those files. This will bypass Nginx and access the Node.js backend directly. That's what I always did when managing my blog.

Alternatively you can create additional location blocks in nginx.conf for "/ghost/", and disable ModSecurity for it but allow access from only your IP. You can find the syntax via Google search.

@craigbutcher
Copy link

I have just stumbled upon this to check if my nginx configuration was good enough. Turns out I was about 3/4 there! Thanks!

@Philio
Copy link

Philio commented Aug 8, 2014

You can use the NodeSource deb repo for the latest NodeJS for the previous 3 LTS releases of Ubuntu: https://deb.nodesource.com/setup

I would be surprised if there isn't also a PPA floating around that has Nginx with Mod Security support.

@hwdsl2
Copy link
Author

hwdsl2 commented Aug 9, 2014

Thanks for the comment Philio! I'll check it out.

@JayY0ung
Copy link

It works! Awesome and thanks for your detailed tutorial :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment