Commit d10b65f3 authored by marc duez's avatar marc duez

nginx config : store server/client locations in separate files

parent 22aa3527
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;
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;
}
location /germline {
root /usr/share/vidjil/;
expires 1h;
add_header Cache-Control must-revalidate;
error_page 405 = $uri;
}
...@@ -24,73 +24,8 @@ server { ...@@ -24,73 +24,8 @@ server {
keepalive_timeout 70; keepalive_timeout 70;
uwsgi_max_temp_file_size 20480m; uwsgi_max_temp_file_size 20480m;
location ~ ^/(vidjil|admin) {
include /etc/nginx/conf.d/web2py/uwsgi.conf;
proxy_read_timeout 600;
client_max_body_size 20G;
###
}
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;
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;
}
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; client_max_body_size 20G;
}
include /etc/vidjil/server_location.conf;
include /etc/vidjil/client_location.conf;
} }
...@@ -7,75 +7,8 @@ server { ...@@ -7,75 +7,8 @@ server {
keepalive_timeout 70; keepalive_timeout 70;
uwsgi_max_temp_file_size 20480m; uwsgi_max_temp_file_size 20480m;
location ~ ^/(vidjil|admin) {
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
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;
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;
}
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; client_max_body_size 20G;
}
include /etc/vidjil/server_location.conf;
include /etc/vidjil/client_location.conf;
} }
location ~ ^/(vidjil|admin) {
include /etc/nginx/conf.d/web2py/uwsgi.conf;
proxy_read_timeout 600;
client_max_body_size 20G;
###
}
location /vidjil/file/upload {
include /etc/nginx/conf.d/web2py/uwsgi.conf;
uwsgi_read_timeout 10m;
client_max_body_size 20G;
}
\ No newline at end of file
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