通过nginx分发到nodejs的端口。
[root@iZ94mgg0rkrZ oneinstack]# more /usr/local/nginx/conf/vhost/nodedemo.sitename.conf
server {
listen 80;
server_name nodedemo.happyfit.studio;
access_log /data/wwwlogs/javademo.sitename.com_nginx.log combined;
index index.html index.htm;
root /data/wwwroot/javademo.sitename.com;
[root@iZ94mgg0rkrZ oneinstack]# more /usr/local/nginx/conf/vhost/nodedemo.sitename.conf
server {
listen 80;
server_name nodedemo.happyfit.studio;
access_log /data/wwwlogs/javademo.sitename.com_nginx.log combined;
index index.html index.htm;
root /data/wwwroot/javademo.sitename.com;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
root /public/;
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
root /public/
expires 7d;
access_log off;
}
location ~ {
proxy_pass http://127.0.0.1:3102;
include proxy.conf;
}
}