67 lines
1.5 KiB
Django/Jinja
67 lines
1.5 KiB
Django/Jinja
## WP NintendojoFR
|
|
fastcgi_cache_path
|
|
/dev/shm/nginx
|
|
levels=1:2
|
|
keys_zone=wpdojo:25m
|
|
inactive=1h
|
|
max_size=250m;
|
|
|
|
server {
|
|
{% include './templates/header.conf.j2' %}
|
|
|
|
root /var/www/www.nintendojo.fr/;
|
|
index index.html index.htm index.php;
|
|
|
|
client_max_body_size 2G;
|
|
|
|
# logo pour le Dojobar :sadcat:
|
|
location ~* ^/public/v6/logo.png$ {
|
|
return 301 https://www.nintendojo.fr/wp-content/themes/ndfr7/images/logo.png;
|
|
}
|
|
|
|
# couper les fichiers cachés
|
|
location ~* /(?:uploads|files)/.*\.php$ {
|
|
deny all;
|
|
}
|
|
|
|
# couper les fichiers textes du captcha
|
|
location ~* /wp-content/uploads/wpcf7_captcha/.*\.txt$ {
|
|
deny all;
|
|
}
|
|
|
|
# redirige twitter
|
|
location /feed/twitter {
|
|
return 307 https://m.nintendojo.fr/@nintendojofr.rss;
|
|
}
|
|
|
|
# Optimisation des images
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
|
expires 1w;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Interprétation PHP
|
|
location ~ ^/(index).php(/.*)+ {
|
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
try_files $fastcgi_script_name =404;
|
|
fastcgi_cache wpdojo;
|
|
fastcgi_cache_key $request_method$host$request_uri;
|
|
fastcgi_cache_valid any 15m;
|
|
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
|
|
fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock;
|
|
fastcgi_read_timeout 60;
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri $uri/ =404;
|
|
fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock;
|
|
fastcgi_read_timeout 60;
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php$uri?$args;
|
|
}
|
|
}
|