9/11/2023 0 Comments Node httpOnce you have this setup you must enable the site defined in the config file above: cd /etc/nginx/sites-enabled/ If you want Nginx (>= 1.3.13) to handle websocket requests as well, add the following lines in the location / section: proxy_http_version 1.1 Proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for # and much more can be added, see nginx config options # pass the request to the node.js server with the correct headers Server_name yourdomain.example access_log /var/log/nginx/ In it you should have something like: # the IP(s) on which your node server is running. This is what I have done in my Ubuntu box:Ĭreate the file yourdomain.example at /etc/nginx/sites-available/: vim /etc/nginx/sites-available/yourdomain.example Therefore you need to set up an Nginx config file for node. Nginx works as a front end server, which in this case proxies the requests to a node.js server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |