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

Ngnix with upstream to uWSGI in AWS vpc is not responding

$
0
0
Hi,

I have an AWS EC2 instance running Nginx with an upstream to uWSGI. Nginx listening to port 8000 and uWSGi listen to port 3031. This server is running inside a private subnet of an AWS VPC. If I try to send request by curl from another server that is in a public subnet of the VPC to this Nginx the connection is timed out with error 504. Requests to other ports (that the Nginx is not listening to) are working OK and also requests to port 80 of the Nginx are working good. So I assume it has something to do with the Nginx configuration or the upstream configuration to the uWSGI.
The Nginx.conf file is following. Nothing is configured yet in the sites-available or sites-enabled.
The AWS security groups are configured with the relevant port opened (port 8000 is opened for inbound traffic).

Does anyone has some experience with the kind of system setup and can help with the configuration?
Thanks,
Yoav

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 1024;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
upstream uwsgicluster{
server 127.0.0.1:3031;
}

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
# gzip_comp_level 6;
# gzip_buffers 16 8k;
gzip_http_version 1.0;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml appl$

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

server {
listen 8000;

location / {
include /home/ubuntu/uwsgi_params;
uwsgi_pass uwsgicluster;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
server {
#running port
listen 80;

index index.nginx-debian.html;
root /var/www/html;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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