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

  • NGINX Cookbook
  • Tim Butler
  • 77字
  • 2021-07-03 00:04:29

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"; 
    } 
} 
主站蜘蛛池模板: 常州市| 台中市| 葫芦岛市| 裕民县| 隆化县| 延寿县| 新乡市| 瑞丽市| 长阳| 历史| 堆龙德庆县| 嘉义市| 巴楚县| 邮箱| 远安县| 嘉义市| 江山市| 伊宁市| 渝北区| 长垣县| 会昌县| 沂南县| 章丘市| 博客| 旬阳县| 仲巴县| 金秀| 织金县| 乌兰浩特市| 金山区| 大埔区| 额尔古纳市| 和林格尔县| 阆中市| 潞城市| 木兰县| 象州县| 磐安县| 米泉市| 汉川市| 朔州市|