Welcome! Log In Create A New Profile


Configuration of nginx in dockerized django app for EC2

Posted by micromegas 
Configuration of nginx in dockerized django app for EC2
January 14, 2020 10:28AM
Hi friends,

I am trying to setup a dockerized django app with nginx with the idea of deploying to EC2. I would need some help with the config. Right now this is my config:

server {

set $my_host $host;
if ($host ~ "\d+\.\d+\.\d+\.\d+") {
set $my_host "ec2-XXXXX.eu-central-2.compute.amazonaws.com";

listen 80;
server_name ec2-XXXXX.eu-central-2.compute.amazonaws.com;
charset utf-8;
error_log /dev/stdout info;
access_log /dev/stdout;

location / {
proxy_pass http://django:5000;
proxy_set_header Host $my_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


the problem is that I am getting a weird error: client sent invalid method while reading client request line, client:, server: ec2-XXXXX.eu-central-2.compute.amazonaws.com, request: "�U�F'��Io�q�+!�P��

Or is there a standard config to achieve what I want?

Any ideas what that could be? Thanks very much!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready