this my nginx.conf and app.conf:
nginx.conf
######
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    large_client_header_buffers 8 512k;
    client_header_buffer_size 512k;
    access_log  /var/log/nginx/access.log  main;
    error_log /var/log/nginx/error.log;
    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
}
#######

app.conf
########
upstream django {
    # server unix:///path/to/your/mysite/mysite.sock; # for a file socket
    server unix:/home/xxxxx/xxxx/django.sock; # for a web port socket (we'll 
use this first)
    #server 127.0.0.1:8056;
}

# configuration of the server
server {
    # the port your site will be served on
    listen      xxxx;
    # the domain name it will serve for
    server_name xx.xx.xx.xx; # substitute your machine's IP address or FQDN
    charset     utf-8;
    client_max_body_size 75M;   # adjust to taste
    #filter php request,asp
    location = /favicon.ico {
    return 204;
    access_log     off;
    log_not_found  off;
    }
    location ~ ^/cgi-bin { return 444; log_not_found off; }
    location ~ \.(?:php|aspx|asp)$ { return 444; log_not_found off; }
    location ~ php\.cgi$ { return 444; log_not_found off; }
    location ~ ^/images/stories { return 444; log_not_found off; }
    location ~ myadmin { return 444; log_not_found off; }
    # Django media
    location /media  {
        alias /home/xxxxx/xxxxx/media;  # your Django project's media files - 
amend as required
    }

    location /static {
        alias /home/xxx/xxx/static; # your Django project's static files - 
amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /home/xxx/xxxx/uwsgi_params; # the uwsgi_params file you 
installed
        }

    location /ws/ {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://unix:/home/xxxx/xxxxx/websocket.sock;
        proxy_buffers 8 64k;
        proxy_buffer_size 64k;
    }

}
########
thx for your reply!
> 在 2016年8月10日,下午6:00,[email protected] 写道:
> 
> Send uWSGI mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
> or, via email, send a message with subject or body 'help' to
>       [email protected]
> 
> You can reach the person managing the list at
>       [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of uWSGI digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: invalid uwsgi request (current strsize: 55272). skip
>      (INADA Naoki)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 9 Aug 2016 20:06:41 +0900
> From: INADA Naoki <[email protected]>
> To: uWSGI developers and users list <[email protected]>
> Subject: Re: [uWSGI] invalid uwsgi request (current strsize: 55272).
>       skip
> Message-ID:
>       <caefz+twrgg86velfqge28kcmtmgzx1eqwvrealjsvpspzhn...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> What is your nginx conf to proxy requests to unix socket?
> 
> On Tue, Aug 9, 2016 at 7:11 PM, Jason Lee <[email protected]> wrote:
>> Hi, I use uwsgi+django
>> some requests don't send to django,just skip by uwsgi
>> request's method is GET with much params, I have set buffer-size 65535
>> Question is like this
>> so how to fix it;
>> 
>> 
>> and this is my demo ini(everything work ok,except some get request, due to
>> params too much)
>> 
>> 
>> [uwsgi]
>> ini = :runserver
>> 
>> [default]
>> # Django-related settings
>> # the base directory (full path)
>> chdir           = /xx/xx/xx/
>> # Django's wsgi file
>> module          = wsgi:application
>> # the virtualenv (full path)
>> home            = /xx/xx/
>> master          = true
>> vacuum          = true
>> no-orphans = true
>> threads = 1
>> env = DJANGO_SETTINGS_MODULE = settings
>> [runserver]
>> ini = :default
>> processes       = 4
>> socket          = /home/xxxx/xxxxx/django.sock
>> # ... with appropriate permissions - may be needed
>> chmod-socket    = 666
>> buffer-size = 65535
>> limit-post = 0
>> module = wsgi
>> 
>> 
>> waiting for you receive.thx
>> 
>> 
>> 
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>> 
> 
> 
> 
> -- 
> INADA Naoki  <[email protected]>
> 
> 
> ------------------------------
> 
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
> 
> 
> End of uWSGI Digest, Vol 83, Issue 4
> ************************************

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to