WebFaction
Community site: login faq

I'm using KrakenJS as a node framework. This uses express, so the issue may lie there. However I've looked at express documentation and krakenjs examples and I'm not doing anything different... so perhaps it's the way nginx and node are interacting for me.

the section in my controller code looks like this:

router.post('/', function (req, res) {  
    res.format({
        json: function () {
          res.json(model);
        },
        html: function () {
            res.render('email/index', model);
        }
    });
});

nothing crazy. if I change post to get, I can send the data and consume it no problem.

please keep in mind that there are no missing variables.

all I'm getting when making the POST request is an error 500 from nginx... which ultimately means there is probably something going on with node? but there is no real logging available to see what's breaking, or why. any ideas?

asked 12 Jun '14, 16:41

bugeyed
1124
accept rate: 0%

edited 12 Jun '14, 16:42

Try running your app in the foreground and watch the output while you trigger the error in your browser. Once you get an error message, add it to your question above and we'll try to help you resolve it.

(12 Jun '14, 22:07) seanf

127.0.0.1 - - [Fri, 13 Jun 2014 12:47:10 GMT] "POST /email HTTP/1.0" 500 42 "(this is my url, it is correct)" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"

This is all that I've been seeing. access log shows the same thing, and nothing in the error log. However, I have noticed that the headers from the request may be giving me a clue.

Remote Address:50.97.173.22:80
Request URL:(my correct url)
Request Method:POST
Status Code:500 Internal Server Error

I'm thinking the POST request is failing before the remove address doesn't match the request URL? or perhaps that host and origin are different in that one includes http://

(13 Jun '14, 12:58) bugeyed

permanent link

answered 13 Jun '14, 23:04

seanf
12.2k41836
accept rate: 37%

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:

×67
×34
×12
×3
×1

question asked: 12 Jun '14, 16:41

question was seen: 5,676 times

last updated: 13 Jun '14, 23:04

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