WebFaction
Community site: login faq

Are http headers modified in any way by nginx for custom apps?

On the client side, my app is sending a request with HTTP version 1.1 and Connection: Keep-Alive. On the server side, it is receiving HTTP version 1.0 and Connection: close.

asked 11 Dec '13, 18:02

aaron_of_tom...
75
accept rate: 0%


These are server-specific settings that can't be passed through the front-end Nginx, so yes the front-end Nginx server is interfering.

The solution usually is to serve your basic site via the shared Nginx on port 80, but have persistent connections (possibly WebSockets) go through an open port on the server instead. You can mark the "Open Port" option in your Custom Application (listening on port) for this purpose.

Some people prefer to serve only an iframe container from the front-end Nginx server and then serve everything in the iframe from the server running under the open port. Something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <title>MySite</title>
  <META name="description" content="MySite"><META name="keywords" content="MySite">
</head>
<frameset rows="100%,*" border="0">
  <frame src="http://123.123.123.123:44444" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>
</html>

If doing this, be sure to map your domain to the open-ports IP address, rather than your server's main IP address.

Hope that helps!

permanent link

answered 12 Dec '13, 03:07

ryans ♦♦
5.0k93260
accept rate: 43%

Great, all working now. Just a note - I also had to switch the site to the Open Port IP address within Webfaction admin.

(13 Dec '13, 15:15) aaron_of_tom...
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:

×21
×10
×9

question asked: 11 Dec '13, 18:02

question was seen: 1,770 times

last updated: 13 Dec '13, 15:15

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