nginx

1.nginx所在目录 sbin/nginx
2.相关命令
  nginx 修改配置文件测试命令:   nginx -t 
  nginx重启命令:  nginx -s reload

3.Node.js应用和一个域名绑定在一起,nginx反向代理

testNode.conf配置如下

server {
        listen       80;
        server_name  testNode.yourdomain.com alias;
        location / {
              proxy_pass http://localhost:8081;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection 'upgrade';
              proxy_set_header Host $host;
              proxy_cache_bypass $http_upgrade;
              access_log  /app/nginxlogs/nodeTest.log  ;
              error_log /app/nginxlogs/nodeTest.error  ;
        }
    }

  

 

posted @ 2023-08-08 19:49  卷叶小树  阅读(7)  评论(0编辑  收藏  举报