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

  • 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"; 
    } 
} 
主站蜘蛛池模板: 兴城市| 奇台县| 皮山县| 静宁县| 漾濞| 彩票| 呼伦贝尔市| 阳东县| 壤塘县| 白玉县| 和政县| 油尖旺区| 自治县| 清水县| 镇安县| 盐亭县| 嘉鱼县| 吉林省| 册亨县| 孝感市| 逊克县| 昭平县| 青海省| 晋城| 苏尼特右旗| 安陆市| 昌吉市| 赣榆县| 钟祥市| 定日县| 永济市| 高淳县| 焦作市| 潼南县| 饶河县| 莒南县| 黎平县| 南江县| 定日县| 福清市| 红安县|