Problems Proxying Offline Web Application

cschiewek nginx-forum at nginx.us
Wed Jun 1 19:38:04 MSD 2011


Hi All,

We're in the process of prototyping some HTML5 offline apps.  They work
offline when running directly from the app server (webrick or unicorn in
this case), but they won't work in offline mode when proxying via nginx.
 We're running 0.8.53.  Here's our config:

user  nginx;
worker_processes  1;

events {
    worker_connections  1024;
}

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

    sendfile        on;
    keepalive_timeout  65;

    ssl_certificate         /etc/ssl/cert.crt;
    ssl_certificate_key  /etc/ssl/key.pem;

    upstream application {
         server unix:/var/sockets/application.sock fail_timeout=0;
    }

    server {
        listen 80;

        client_max_body_size 4G;
        server_name server.fqdn.com;
        keepalive_timeout 5;
        root /srv/www/application;
        index index.html;

        location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto https;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          proxy_pass http://applicaiton;
          if ($query_string ~ "^[0-9]+$") {
            add_header Cache-Control public;
          }
        }
    }
}

Any help/guidance is much appreciated :)

Thanks,

Curtis

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,203030,203030#msg-203030




More information about the nginx mailing list