This question already has an answer here:
How to set gunicorn limit_request_line parameter over 8190?
(1 answer)
Closed 1 year ago.
I am using nginx and gunicorn to deploy my django project, when I use GET funcation posted data to server I get the error:
Bad Request
Request Line is too large (8192 > 4094)
On nginx.conf I have:
client_max_body_size 100g;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
Many methods on the Internet are changing "large_client_header_buffers" from 4 512k; but didn't fix the problem.
Any help or explanation is welcome! Thank you.
it is gunicorn issue, not Nginx
you can change the limit
--limit-request-line
https://docs.gunicorn.org/en/stable/settings.html#limit-request-line
Related
This question already has answers here:
Docker & Postgres: Failed to bind tcp 0.0.0.0:5432 address already in use
(11 answers)
Closed 9 months ago.
When working with Docker and Django setup Initially sometime we will getting this error port 5432 already in use or TCP/IP not able to make connection. How to resolve this issue please find below.
This issue will happen because of two cases :
By suddenly stop or restart the system without closing the docker or DB to resolve it kill all PID ID by running this command kill -9 PID and kill all PID
Second issue was happening due to already in our system another Docker is present with same configuration then we have to change its name. along with it dont forgot to Inssert this line into settings.py DOMAIN_URL = config("DOMAIN_URL", "http://localhost:8000/") or DOMAIN_URL = "http://localhost:8000/"
This question already has answers here:
Are a WSGI server and HTTP server required to serve a Flask app?
(3 answers)
Closed 12 months ago.
I have a flask application, and I want to run this application in production. Is it possible to do this without your own server and if yes where it is possible?
Yes, You can run the flask application through your own webserver such as Apache2 or Nginx hosted in your own server.
Check this out for more info
https://flask.palletsprojects.com/en/2.0.x/deploying/
This question already has answers here:
Making django server accessible in LAN
(4 answers)
Closed 1 year ago.
I created webpage on local server with django framework (python). I have acces to it under address http://localhost:8000/. Now I want to share it over local network. I try to do it with Windows firewall Inbound/outbound rules, but it seems either I do something wrong or it's not enough.
To access a Django project running on a local network, you have to runserver with 0.0.0.0 as IP
python manage.py runserver 0.0.0.0:8000
and then set
ALLOWED_HOSTS = ["localhost", "yours_host_ip_aaddress"]
that should work if your firewall allows!
I am not sure how to suggest a duplicate question, but seems your question have an answer here. Basically, you need to ask the django program to accept connection from the outside world by
python manage.py runserver 0.0.0.0:8000
I've followed this tutorial and i'm running into an ERR_SSL_PROTOCOL_ERROR that i just can't figure out.
I must mention that i have set inside settings.py:
DEBUG = FAlSE
SECURE_SSL_REDIRECT = False
And my Allowed_hosts is ['*'].
I have a number of questions which reading alot of blog posts hasn't answered:
In the nginx configuration, if i'm running the server from a laptop connected to a router, and the external IP is 12.34.56.78 and the port is 50000, what am i supposed to put at server_name?
In the gunicorn configuration, everyone states that this is the config command: gunicorn --bind 0.0.0.0:8800 AWESOME.wsgi:application what IP should i put there in my case? 12.34.56.78:50000 or just leave it like it is?
As i understand the situation, given the setting in django settings.py my server is not serving HTTPS so the error does not come from that. I've also read about certbot but since i don't have even those 2 above questions figured out i cannot understand how to configure certbot..
EDIT
In fact i've tried to:
gunicorn --bind 12.34.56.78:50000 KYng.wsgi:application but i'm getting invalid address error
1.) You actually don't need to put anything in there, as it will default to an empty string.
2.) You should put localhost (127.0.0.1) if you want it to run locally, or 0.0.0.0 if you want it to run publicly.
Concerning the ssl error, check your nginx configuration more closely...that you didn't reference https instead of http somewhere...
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have my server configured like this (this is on a fresh install of ubuntu 10.10)
nginx + gunicorn + django + supervisord to run it
when I try to access my site, I get a 502 error. and this will show up in the error log:
2011/06/03 10:40:59 [error] 15066#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: [retracted], server: [retracted], request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:29000/", host: "[retracted]"
Here is my nginx.conf
http://pastebin.com/t0V2yFxr
Here is my supervisord.conf
http://pastebin.com/pqVqRLSk
and my gunicorn.conf
bind = "127.0.0.1:29000"
logfile = "/sites/[retracted]/logs/gunicorn.log"
workers = 3
when I run
sudo supervisordctl status
it returns nothing. So this makes me suspect that it is not properly running. However, there is no supervisord.log file (in /var/log/ or in /code/[]/logs/) or gunicorn.log showing errors.
So I cannot debug this at all. Any suggestions on how to get this takin care of?
You can do debugging if you run supervisord in this way::
supervisord --nodaemon --loglevel DEBUG
All errors will be dumped to the console.
Also you can try to run debug server on this machine. Maybe your site does not work at all.
If supervisorctl status isn't showing anything then it sounds like you didn't run supervisorctl reload after updating the configuration.