Websocket - Nginx proxy pass 400 Bad Request

330 views
Skip to first unread message

ridwan effendi

unread,
Jun 16, 2015, 6:23:44 AM6/16/15
to ratch...@googlegroups.com


I am setting up Websocket in nginx with SSL. This is the example code :

App code :
...
var conn = new ab.Session('wss://domain.com',
...

Nginx.conf :
...
server
{
    charset utf
-8;
    client_max_body_size
128M;

   
#listen       80 default_server;
    listen      
443 ssl;
    server_name  domain
.com;
    root        
/root/app;
    index        index
.php index.html index.htm;

    ssl_certificate      
/etc/ssl/bundle.crt;
    ssl_certificate_key  
/etc/ssl/domain.key;
    ssl_protocols
TLSv1 TLSv1.1 TLSv1.2;

   
#charset koi8-r;

   
#access_log  /var/log/nginx/host.access.log  main;

   
# Load configuration files for the default server block.
    include
/etc/nginx/default.d/*.conf;

    location / {
            autoindex  on;
            try_files $uri $uri/ /index.php?$args;

            proxy_pass http://localhost:8080;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";

     }
...

Until this step, the Websocket has been connected to the server. but where i try to accesshttps://domain.com eventhough i have been able to access https://domain.com/index.html. there are some 400 error on asset. how do i fix the 400 error ?
Reply all
Reply to author
Forward
0 new messages