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

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"; 
    } 
} 
主站蜘蛛池模板: 宜春市| 延安市| 杂多县| 江都市| 水城县| 基隆市| 灵璧县| 柘城县| 石城县| 伊金霍洛旗| 梧州市| 奉节县| 翁源县| 惠来县| 呼玛县| 山东| 原平市| 博兴县| 额济纳旗| 临漳县| 武鸣县| 高雄县| 株洲市| 杭锦后旗| 麦盖提县| 集贤县| 铜川市| 上虞市| 灵武市| 海丰县| 成安县| 平顶山市| 吉木萨尔县| 宾阳县| 雷波县| 甘肃省| 托克托县| 福州市| 宜章县| 卓尼县| 南江县|