Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Request (400) after installing FIR #46

Closed
ereuven opened this issue Nov 26, 2015 · 17 comments
Closed

Bad Request (400) after installing FIR #46

ereuven opened this issue Nov 26, 2015 · 17 comments
Assignees
Labels

Comments

@ereuven
Copy link

ereuven commented Nov 26, 2015

I followed the instructions in the production installation part, and when I'm trying to access the webpage I getting Bad Request (400) error. No clues in Nginx log files.

@tomchop tomchop added the bug label Nov 26, 2015
@tomchop
Copy link
Contributor

tomchop commented Nov 26, 2015

Thanks for bringing this up. I'll try to reproduce on my end and let you know what's up.

@tomchop tomchop self-assigned this Nov 26, 2015
@ereuven
Copy link
Author

ereuven commented Nov 26, 2015

Thank you. I've installed it directly, without using virtualenv.

@spcampbell
Copy link

I got the same thing but remedied it and I unfortunately do not remember exactly what fixed it. I am fairly sure that it was a path in one of the config files. Look them over carefully, especially the FCGI configuration. You'll see some places where it has paths like: /path/to/your/fir/install/ You need to modify all of these locations to the correct path. These are not clearly outlined in the text of the instructions but will be obvious when you look for them.

The other thing I messed with was the hostname but I don't think that was the source of the 400 error. If you fix all the paths and still get the error, reply here and we'll check some other things.

@ereuven
Copy link
Author

ereuven commented Nov 27, 2015

OK, thanks to spcampbell I managed to solve it.
I did not find another place in the configuration files where I forget to change the path (so probably the explanations in the wiki are good).
The problem was in production.py, line 9. It defines the allowed hosts (by default some example domain). I changed it to: ALLOWED_HOSTS = ['127.0.0.1','localhosts'] and then it worked.

Thank you all.
I think you should add this issue to the instructions on the wiki page. And maybe even change the default to localhost, because it using FCGI and reverse proxy it doesn't have to listen to remote connections.

@ereuven ereuven closed this as completed Nov 27, 2015
@tomchop
Copy link
Contributor

tomchop commented Nov 27, 2015

Thanks a lot for your feedback. Are you sure it's localhosts, with an s? Or is it just a typo?
In any case, we'll add both 127.0.0.1 and localhost to the default ALLOWED_HOSTS so that it's more clear to future users.

@ereuven
Copy link
Author

ereuven commented Nov 27, 2015

My mistake, it's localhost without s

@spcampbell
Copy link

FYI I went back and tested to see what it was that fixed my 400 errors. I actually had to put the ip address of the server in the ALLOWED_HOSTS setting. Localhost or 127.0.0.1 did not allow it to work.

@tomchop
Copy link
Contributor

tomchop commented Nov 30, 2015

Yes, AFAIU the ALLOWED_HOSTS directive in Django specifies which vhosts the Django service should be answering requests to. This needs to be adjusted according to your deployment scheme - we'll specify it in the wiki. Thank you all for your comments.

@Waseem-farooqui
Copy link

I want to see the django interface at public IP what should I do for it.
I did following steps but failed.

  1. In production.py I have added '0.0.0.0' in ALLOWED_HOSTS
  2. In /etc/init/fir.conf I changed host=0.0.0.0 port=8000 #Some How Default Django port
  3. In nginx configurations added server_name 0.0.0.0;
  4. In nginx fastcg_pass 127.0.0.1:8000;
    But still I got 404 when accessing the staticip.
    Where as I can access it on localhost, Where I am wrong please guide me ?

@tomchop
Copy link
Contributor

tomchop commented Dec 21, 2015

What hostname are you using to browse to FIR? That's what you need to add to the ALLOWED_HOSTS array?

@Waseem-farooqui
Copy link

I am writing the static_ip that I have assigned to the system in browser.

@tomchop
Copy link
Contributor

tomchop commented Dec 22, 2015

That value should be the one you add to ALLOW_HOSTS

@Waseem-farooqui
Copy link

I have added 0.0.0.0 which means allow all the hosts.
Why should I add my static_ip say 111.111.111.111 I have added 0.0.0.0 and localhost in ALLOW_HOSTS.

@tomchop
Copy link
Contributor

tomchop commented Dec 22, 2015

No, the ALLOW_HOSTS field specifies which virtual hosts should the Django app answer requests to, like the virutal hosts in you nginx config.

@Waseem-farooqui
Copy link

Thanks its working 👍
I was thinking from different prospective.

@ulhaqikram125
Copy link

fir start/running, process 5672..terminal give this message.how to check that FIR is running??

@tomchop
Copy link
Contributor

tomchop commented Feb 18, 2016

If you followed the instructions you should have an upstart script, so you can sudo status fir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants