Nginx Reverse Proxy deployment Nodejs nginx Reverse proxy nodejs nodejs Framework Nginx proxy Nodej

Source: Internet
Author: User
Tags nginx reverse proxy
Node development phase, generally used httpModule to start a local server, easy to debug.
It's probably like this:

varrequire("http");var server = http.createServer();server.listen(8888);

So the question is, how do I deploy my application to the VPS? You can't use it http://10.88.77.66:8888 to access it? Yes, the title of the article is the solution.

My environment is roughly the same centos 6 lnmp一键部署 . As lnmp for how to operate, I will not write. Google for yourself

Suppose my domain name is money.ivan.com I want to proxy it to http://10.88.77.66:8888 , next modify the corresponding domain name nginx config file

  upstream Nodejs {server  127.0  . 0  . 1    :  8888 ;  #server   127.0  . 0     . 1 :  8888 ; KeepAlive  ;}    server {Listen  ; server_name Money .  Ivan .     com Access_log/home/wwwlogs/money .  Ivan .  COM .      log  access;        Location / {proxy_set_header X -real  -ip   $remote _addr ;        Proxy_set_header X -forwarded  -for   $proxy _add_x_forwarded_for ;        Proxy_set_header Host  $http _host ;        Proxy_set_header X -nginx  -proxy   true ;        Proxy_set_header Connection  "" ;    Proxy_pass http: //nodejs;  }}

Through the above modification, so that nginx reverse proxy to our site. can be money.ivan.com accessed by visiting our application.

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the Nginx reverse proxy deployment Nodejs, including the nodejs,nginx aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.