Guest User

Untitled

a guest
Aug 9th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. server {
  2. listen 198.27.64.29:80;
  3. listen 127.0.0.1:80;
  4. listen [2607:5300:60:191d::1]:80;
  5. server_name community.pcgamingwiki.com;
  6. root /webroot/pcgw-extras/ipb;
  7. client_max_body_size 2048m;
  8.  
  9. server_name_in_redirect on;
  10. error_page 500 501 502 503 504 /error.html;
  11. error_page 404 /404.html;
  12. index index.php index.html index.htm;
  13.  
  14. #Rewrite rules for IPB
  15. try_files $uri $uri/ /index.php?q=$request_uri;
  16.  
  17. location / {
  18. if (!-e $request_filename){
  19. rewrite \.(jpeg|jpg|gif|png)$ /public/404.php break;
  20. }
  21. if (!-e $request_filename){
  22. rewrite ^(.*)$ /index.php break;
  23. }
  24. }
  25.  
  26. location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
  27. access_log off;
  28. log_not_found off;
  29. expires 30d;
  30. }
  31.  
  32. location ~* ^/(uploads|hooks|cache)/.*\.(php|cgi|pl|py|php3|php4|php5|php6|phtml|shtml)$
  33. {
  34. deny all;
  35. }
  36.  
  37. location /forums/ {
  38. index index.php;
  39. try_files $uri $uri/ /forums/index.php?$uri&$args;
  40. rewrite ^ /index.php? last;
  41. }
  42.  
  43. location /forums {
  44. index index.php;
  45. try_files $uri $uri/ /forums/index.php?$uri&$args;
  46. rewrite ^ /index.php? last;
  47. }
  48.  
  49. # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  50. location ~ /\. {
  51. deny all;
  52. }
  53.  
  54. location ~ \.php?$ {
  55. include /etc/nginx/fastcgi_params;
  56. fastcgi_pass unix:/var/run/php5-fpm.sock;
  57. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  58. fastcgi_index index.php;
  59. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  60. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment