Add nginx configuration file
Includes preparation.pdf rule
This commit is contained in:
parent
5f45aaa77b
commit
81d822db18
1 changed files with 47 additions and 0 deletions
47
nginx/nginx.conf
Normal file
47
nginx/nginx.conf
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
upstream bocal {
|
||||||
|
server unix:/srv/bocal.cof.ens.fr/bocal.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
include include/ssl_keys;
|
||||||
|
|
||||||
|
server_name bocal.cof.ens.fr;
|
||||||
|
access_log /var/log/nginx/bocal.cof.ens.fr.log;
|
||||||
|
|
||||||
|
root /srv/bocal.cof.ens.fr/site/public;
|
||||||
|
|
||||||
|
# Static files
|
||||||
|
location ~ ^/static/ {
|
||||||
|
include include/static;
|
||||||
|
}
|
||||||
|
location ~ ^/media/ {
|
||||||
|
include include/static;
|
||||||
|
}
|
||||||
|
location ~ ^/bocal_www/ {
|
||||||
|
include include/static;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Direct access to preparation.pdf
|
||||||
|
location ~ ^/preparation\.pdf {
|
||||||
|
# No cache control - this will change quite often
|
||||||
|
root /srv/bocal.cof.ens.fr/site/public/bocal_www/;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Django app
|
||||||
|
location ~ ^/ {
|
||||||
|
include include/proxy_params;
|
||||||
|
proxy_pass http://bocal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name bocal.cof.ens.fr;
|
||||||
|
access_log /var/log/nginx/bocal.cof.ens.fr.log;
|
||||||
|
|
||||||
|
return 302 https://bocal.cof.ens.fr$request_uri;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue