Skip to content

Instantly share code, notes, and snippets.

@jonalvarezz
Created January 27, 2014 05:40
Show Gist options
  • Save jonalvarezz/8643731 to your computer and use it in GitHub Desktop.
Save jonalvarezz/8643731 to your computer and use it in GitHub Desktop.
Nginx as frontend proxy for Ghost
server {
server_name www.sitedomain.com;
rewrite ^ http://sitedomain.com$request_uri? permanent;
}
server {
listen 0.0.0.0:80;
server_name sitedomain.com;
access_log /var/log/nginx/sitedomain.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
# Ghost IP and port. see ghost config.js
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment