Created
January 30, 2015 03:56
-
-
Save likidu/f5f77add7b2c9cfa02a3 to your computer and use it in GitHub Desktop.
Deploy morpheus with Nginx and PM2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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