简体   繁体   中英

Jquery web page and node.js as server

I am completely new to node.js

I am web developer and I already have a jquery mobile webpage. My team is moving the server from php (same server as my page) to node.js and I have a problem due to cross domain.

How should I tell them to configure node server to work in the same port as apache? Now apache is running on 80 and node.js in 8080 but we want to change the second one to be able to work with my page.

If this is not possible, would be possible to return my webpage from node.js server? How should we do this? Webpage just depends on the server to get data.

You can redirect port 80 to port 8008 using this command:

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

Hope that helps.

Got this from this stackoverflow question .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM