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

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"; 
    } 
} 
主站蜘蛛池模板: 加查县| 融水| 陆丰市| 安化县| 保德县| 澄迈县| 张家口市| 墨竹工卡县| 即墨市| 麟游县| 玛纳斯县| 阜阳市| 镶黄旗| 鄄城县| 望谟县| 乐都县| 肃南| 怀远县| 丽水市| 陈巴尔虎旗| 寻乌县| 怀远县| 乡宁县| 固原市| 遵义县| 海口市| 禹城市| 柳河县| 丹巴县| 沂水县| 台湾省| 县级市| 登封市| 秀山| 连州市| 察哈| 大姚县| 会昌县| 交口县| 贡山| 宁远县|