官术网_书友最值得收藏!

How to do it...

Now that we have a very simple Express application, we'll place NGINX in front of it. Although Node.js is extremely fast, NGINX is not only faster but offers far more configurability. Even with WebSockets, we're still able to proxy this through NGINX. Let's take a look at the configuration:

server { 
    listen       80; 
    server_name  express.nginxcookbook.com; 
 
    access_log  /var/log/nginx/express-access.log  combined; 
 
    location / { 
         proxy_pass http://127.0.0.1:3000; 
         proxy_http_version 1.1; 
         proxy_set_header Upgrade $http_upgrade; 
         proxy_set_header Connection "upgrade"; 
    } 
} 
主站蜘蛛池模板: 上思县| 四子王旗| 大足县| 辽阳县| 沐川县| 淳化县| 临沧市| 武胜县| 射洪县| 郯城县| 石台县| 黔西县| 衡阳县| 南昌市| 宁德市| 霍林郭勒市| 天长市| 辉县市| 贵州省| 阳原县| 宜都市| 射洪县| 嵊州市| 定州市| 确山县| 东阳市| 沂水县| 泾阳县| 白山市| 三明市| 岑巩县| 家居| 云梦县| 平安县| 汶上县| 当雄县| 阳江市| 洱源县| 扶沟县| 克山县| 潮安县|