nginx_web2py 2.3 KB
Newer Older
1 2 3 4
upstream uwsgi {
    server uwsgi:8000;
}

5 6 7 8 9 10 11 12 13
server {
        listen 80;
        server_name     $hostname;

        location / {
                return 301 https://$host/browser;
        }
}

14 15 16 17 18 19 20 21 22 23 24
server {
        listen 443 default_server ssl;
        server_name     $hostname;
        ssl_certificate         /etc/nginx/ssl/web2py.crt;
        ssl_certificate_key     /etc/nginx/ssl/web2py.key;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        keepalive_timeout    70;
25

26
        uwsgi_max_temp_file_size 20480m;
27

28
        location / {
Ryan Herbert's avatar
Ryan Herbert committed
29
            rewrite /([0-9]+)/([0-9]+)(/+) /?set=$1&conf=$2 break;
30 31 32 33 34 35 36 37 38
            root /usr/share/vidjil;
            expires 1h;
            add_header Cache-Control must-revalidate;

            error_page 405 = $uri;

        }

        location /vidjil {
39
            include /etc/nginx/conf.d/web2py/uwsgi.conf;
40 41 42 43 44 45 46 47 48 49 50
            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

    location /germline {
        root /usr/share/vidjil/;
        expires 1h;
51
        add_header Cache-Control must-revalidate;
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

        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;
    
    }
78 79 80 81 82 83

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