Correction : wordpress letabli.
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Mon, 20 Oct 2014 13:44:56 +0000 (15:44 +0200)
committerJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Mon, 20 Oct 2014 13:44:56 +0000 (15:44 +0200)
etc/nginx/site.d/cyclo-letabli/site.conf

index 49db553..f0a2f14 100644 (file)
@@ -3,8 +3,14 @@ server_name
  letabli.org;
 root /home/www/data/cyclo-letabli/www;
 
+rewrite /wp-admin$ $scheme://$host$uri/ permanent;
+       # Add trailing slash to */wp-admin requests.
+location = /wp-admin/ {
+       return 301 /wp-admin/index.php?$args;
+ }
 location / {
        index index.html index.htm index.php;
+       try_files $uri $uri/ /index.php?$args;
  }
 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
        access_log off;
@@ -44,6 +50,10 @@ location ~ \.php(|/.+)$ {
        fastcgi_pass_header Cookie;
        fastcgi_pass_header Set-Cookie;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
+       if (!-f $document_root$fastcgi_script_name) {
+               # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)
+               return 404;
+        }
        
        fastcgi_pass unix:/run/php5/fpm/letabli;
  }