WebFaction
Community site: login faq

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:

  1. nginx app running on port X residing at ~/webapps/nginx

  2. express app running on node server on port Y residing at ~/webapps/nodeapp

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
524
accept rate: 0%


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.

permanent link

answered 29 May '12, 12:01

todork
1.2k5
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×34
×12

question asked: 29 May '12, 09:58

question was seen: 5,143 times

last updated: 29 May '12, 12:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM