Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Configuration of nginx in dockerized django app for EC2

$
0
0
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: 80.153.184.19, 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!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>