nginx_web2py_http 2.39 KB
Newer Older
1
upstream uwsgi {
Ryan Herbert's avatar
Ryan Herbert committed
2
    server uwsgi:8000;
3 4 5 6 7 8 9 10
}

server {
        listen 80 default_server;
        keepalive_timeout    70;

        uwsgi_max_temp_file_size 20480m;

11
        location ~ /(vidjil|admin) {
12 13 14 15 16 17 18 19 20
            include /etc/nginx/conf.d/web2py/uwsgi.conf;
            proxy_read_timeout 600;
            client_max_body_size 20G;
            ###
        
        }
        ## if you serve static files through https, copy here the section
        ## from the previous server instance to manage static files

marc duez's avatar
marc duez committed
21 22 23 24 25 26 27 28
        location / {
            root /usr/share/vidjil/browser;       
            rewrite ^/([0-9]+)-([0-9]+)/(css|js|image|test)/(.*) /$3/$4 redirect;
            rewrite ^/([0-9]+)-([0-9]+)/ /?set=$1&config=$2 redirect;
            rewrite ^/([0-9]+)-([0-9]+) /?set=$1&config=$2 redirect;
            
            expires 1h;
            add_header Cache-Control must-revalidate;
29

marc duez's avatar
marc duez committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43
            error_page 405 = $uri;
        }
        
        location /browser {
            root /usr/share/vidjil;       
            rewrite ^/browser/([0-9]+)-([0-9]+)/(css|js|image|test)/(.*) /browser/$3/$4 redirect;
            rewrite ^/browser/([0-9]+)-([0-9]+)/ /browser/?set=$1&config=$2 redirect;
            rewrite ^/browser/([0-9]+)-([0-9]+) /browser/?set=$1&config=$2 redirect;
            
            expires 1h;
            add_header Cache-Control must-revalidate;

            error_page 405 = $uri;
        }
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

    location /germline {
        root /usr/share/vidjil/;
        expires 1h;
        add_header Cache-Control must-revalidate;

        error_page 405 = $uri;
    
    }

    ###to enable correct use of response.static_version
    #location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
        #    alias /usr/share/vidjil/server/web2py/applications/$1/static/$2;
        #    expires max;
        #
    #}
    ###

    client_max_body_size 20G;

    location /cgi/ {
        gzip off;
        root  /usr/share/vidjil/browser/;
        # Fastcgi socket
        fastcgi_pass  unix:/var/run/fcgiwrap.socket;
        # Fastcgi parameters, include the standard ones
        include /etc/nginx/fastcgi_params;
        # Adjust non standard parameters (SCRIPT_FILENAME)
        fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    
    }

    location /vidjil/file/upload {
        include /etc/nginx/conf.d/web2py/uwsgi.conf;
        uwsgi_read_timeout 10m;
        client_max_body_size 20G;
    }
}