Skip to content

Instantly share code, notes, and snippets.

@likidu
Created January 30, 2015 03:56
Show Gist options
  • Save likidu/f5f77add7b2c9cfa02a3 to your computer and use it in GitHub Desktop.
Save likidu/f5f77add7b2c9cfa02a3 to your computer and use it in GitHub Desktop.
Deploy morpheus with Nginx and PM2
server
{
listen 80;
#listen [::]:80;
server_name likidu.com www.likidu.com;
index index.html index.htm;
root /home/wwwroot/likidu.com;
include none.conf;
#error_page 404 /404.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
}
# This is important: the static files needs redirection as well
location ~ .*\.(js|css|gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
add_header Pragma public;
add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
proxy_pass http://127.0.0.1:3000;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment