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

  • 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"; 
    } 
} 
主站蜘蛛池模板: 涟源市| 涪陵区| 星子县| 吉隆县| 高密市| 永康市| 河津市| 榆林市| 蓬安县| 隆尧县| 和硕县| 黎平县| 平阴县| 龙井市| 宁南县| 余江县| 麻江县| 精河县| 富蕴县| 玛多县| 鞍山市| 深州市| 苍山县| 泾川县| 永宁县| 中牟县| 浠水县| 通山县| 海宁市| 印江| 白河县| 西乌| 中宁县| 紫金县| 扬中市| 宝兴县| 莱西市| 布尔津县| 无锡市| 南投县| 喜德县|