Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 2a9f0d56 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

nginx* refactor uwsgi configuration for new route

Having such a high value for uwsgi_read_timeout does not make sense for
most requests. Therefore it makes sense to create a new route for
uploading which has its own value for that parameter.

Placing the configuration in the separate file helps prevent
duplication.
parent dbbea28e
......@@ -48,6 +48,7 @@ run cd /usr/share/web2py && chown -R www-data:www-data .
copy ./conf/gzip_static.conf /etc/nginx/conf.d/web2py/gzip_static.conf
copy ./conf/gzip.conf /etc/nginx/conf.d/web2py/gzip.conf
copy ./conf/uwsgi.conf /etc/nginx/conf.d/web2py/uwsgi.conf
copy ./sites/nginx_conf /etc/nginx/sites-enabled/web2py
copy ./sites/nginx_conf /etc/nginx/sites-available/web2py
......
uwsgi_pass uwsgi;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
......@@ -24,17 +24,9 @@ server {
keepalive_timeout 70;
uwsgi_max_temp_file_size 20480m;
uwsgi_read_timeout 10m;
location / {
uwsgi_pass uwsgi;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
include /etc/nginx/conf.d/web2py/uwsgi.conf
proxy_read_timeout 600;
client_max_body_size 20G;
###
......@@ -80,4 +72,10 @@ server {
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;
}
}
......@@ -61,6 +61,17 @@ gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
' > /etc/nginx/conf.d/web2py/gzip.conf
echo '
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME \$scheme;
uwsgi_param SERVER_SOFTWARE nginx/\$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
' > /etc/nginx/conf.d/web2py/uwsgi.conf
# Create configuration file /etc/nginx/sites-available/web2py
echo "server {
listen 80;
......@@ -83,18 +94,9 @@ server {
client_body_temp_path /mnt/data/tmp;
uwsgi_max_temp_file_size 20480m;
uwsgi_temp_path /mnt/data/tmp;
uwsgi_read_timeout 10m;
location / {
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME \$scheme;
uwsgi_param SERVER_SOFTWARE nginx/\$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
include /etc/nginx/conf.d/web2py/uwsgi.conf
proxy_read_timeout 600;
client_max_body_size 20G;
###
......@@ -145,6 +147,12 @@ server {
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;
}
}" >/etc/nginx/sites-available/web2py
ln -s /etc/nginx/sites-available/web2py /etc/nginx/sites-enabled/web2py
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment