imcrazytwkr

Basic pmwiki nginx config

Dec 17th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.03 KB | None | 0 0
  1. server {
  2.     server_name pmwiki.lcl;
  3.     root /var/www/pmwiki/pub;
  4.     index index.php;
  5.  
  6.     location / {
  7.         try_files $uri $uri/ @pmwiki;
  8.     }
  9.  
  10.     location @pmwiki {
  11.         rewrite ^/(.*) /index.php?n=$1;
  12.     }
  13.  
  14.     # Secure PHP handling
  15.     location ~ \.php$ {
  16.       try_files $uri =404;
  17.       fastcgi_pass unix:/var/run/php5-fpm.sock;
  18.       fastcgi_index index.php;
  19.       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  20.       include fastcgi_params;
  21.     }
  22.  
  23.     # Cache configuration for most common files
  24.     location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
  25.         expires max;
  26.         add_header Pragma public;
  27.         add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  28.     }
  29.  
  30.     # Drop common log errors
  31.     location = /robots.txt { access_log off; log_not_found off; }
  32.     location = /favicon.ico { access_log off; log_not_found off; }
  33.     location ~ /\. { access_log off; log_not_found off; deny all; }
  34.     location ~ ~$ { access_log off; log_not_found off; deny all; }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment