I have a custom app written using Express web framework on nodejs. I want to use nginx as a reverse proxy on it now and deliver all static content through nginx instead of my node server. Right now, I have two separate webfaction apps installed and running:
I am not exactly clear what I need to do now to setup nginx to serve my static content and proxy all other requests to my node app. Any pointers would be really helpful. asked 29 May '12, 09:58 Rajat |
Hi, You don't need to install your own Nginx server to serve static content through it. All traffic goes through our shared Nginx server anyway, so you can use the shared Nginx server for static content, and your Express app for everything else. This is accomplished by creating a "Static-only" app from the control panel, and assigning it to /static (or any URL path that you prefer) in the website configuration in the control panel. In other words, your website would have two apps - your Express app with URL Path set to "/", and a static-only app with URL Path set to "/static". I hope this helps! If you run into troubles while implementing this, please open a ticket, so we can take a look at your set up and help you out. answered 29 May '12, 12:01 todork |