configs: Rework nginx configs
This commit is contained in:
parent
a0a1a717ee
commit
fb53c9a4f1
13 changed files with 54 additions and 286 deletions
63
configs/nginx/base/static.conf
Normal file
63
configs/nginx/base/static.conf
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
server_name fic.srs.epita.fr;
|
||||
|
||||
access_log /var/log/nginx/fic2016.access_log main;
|
||||
error_log /var/log/nginx/fic2016.error_log info;
|
||||
|
||||
root /srv/www/fic2016-static/;
|
||||
|
||||
error_page 403 404 /e404.html;
|
||||
error_page 413 404 /e413.html;
|
||||
error_page 500 502 504 /e500.html;
|
||||
|
||||
location /.htaccess {
|
||||
return 404;
|
||||
}
|
||||
location /chbase.sh {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ ^/[0-9] {
|
||||
rewrite ^/.*$ /index.html;
|
||||
}
|
||||
|
||||
location /edit {
|
||||
rewrite ^/.*$ /index.html;
|
||||
}
|
||||
|
||||
location /rank {
|
||||
rewrite ^/.*$ /index.html;
|
||||
}
|
||||
|
||||
location /tags/ {
|
||||
rewrite ^/.*$ /index.html;
|
||||
}
|
||||
|
||||
location = /welcome.html {
|
||||
internal;
|
||||
if ($http_accept ~ "^application/json") {
|
||||
rewrite ^/(.*).html$ /$1.json;
|
||||
}
|
||||
}
|
||||
location = /e404.html {
|
||||
internal;
|
||||
if ($http_accept ~ "^application/json") {
|
||||
rewrite ^/(.*).html$ /$1.json;
|
||||
}
|
||||
}
|
||||
location = /e413.html {
|
||||
internal;
|
||||
if ($http_accept ~ "^application/json") {
|
||||
rewrite ^/(.*).html$ /$1.json;
|
||||
}
|
||||
}
|
||||
location = /e500.html {
|
||||
internal;
|
||||
if ($http_accept ~ "^application/json") {
|
||||
rewrite ^/(.*).html$ /$1.json;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in a new issue