nginx proxy to comet

后端 未结 7 852
离开以前
离开以前 2021-01-30 04:26

I need some help from some linux gurus. I am working on a webapp that includes a comet server. The comet server runs on localhost:8080 and exposes the url localhost:8080/long_po

7条回答
  •  遥遥无期
    2021-01-30 05:27

    Here's my nginx.conf and my proxy.conf. Note however that the proxy.conf is way overkill - I was just setting all these settings while trying to debug my program.

    /etc/nginx/nginx.conf

    worker_processes  1;                                                                                                                                     
    user www-data;
    
    error_log  /var/log/nginx/error.log debug;
    pid        /var/run/nginx.pid;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include /etc/nginx/proxy.conf;
    
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        access_log  /var/log/nginx/access.log;
    
        sendfile        on;
        tcp_nopush     on;
    
        keepalive_timeout  600;
        tcp_nodelay        on;
    
        gzip  on;
        gzip_comp_level 2;
        gzip_proxied any;
        gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
    }
    

    /etc/nginx/proxy.conf

    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;
    client_max_body_size        10m;
    client_body_buffer_size     128k;
    proxy_connect_timeout       6000;
    proxy_send_timeout          6000;
    proxy_read_timeout          6000;
    proxy_buffer_size           4k;
    proxy_buffers               4 32k;
    proxy_busy_buffers_size     64k;
    proxy_temp_file_write_size  64k;
    send_timeout                6000;
    proxy_buffering             off;
    proxy_next_upstream error;
    

提交回复
热议问题