wordpress2_rewrite.tpl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. server {
  2. listen %ip%:%web_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. root %docroot%;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  8. error_log /var/log/nginx/domains/%domain%.error.log error;
  9. location = /favicon.ico {
  10. log_not_found off;
  11. access_log off;
  12. }
  13. location = /robots.txt {
  14. allow all;
  15. log_not_found off;
  16. access_log off;
  17. }
  18. location / {
  19. try_files $uri $uri/ /index.php?$args;
  20. if (!-e $request_filename)
  21. {
  22. rewrite ^(.+)$ /index.php?q=$1 last;
  23. }
  24. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  25. expires max;
  26. }
  27. location ~ [^/]\.php(/|$) {
  28. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  29. if (!-f $document_root$fastcgi_script_name) {
  30. return 404;
  31. }
  32. fastcgi_pass %backend_lsnr%;
  33. fastcgi_index index.php;
  34. include /etc/nginx/fastcgi_params;
  35. }
  36. }
  37. error_page 403 /error/404.html;
  38. error_page 404 /error/404.html;
  39. error_page 500 502 503 504 /error/50x.html;
  40. location /error/ {
  41. alias %home%/%user%/web/%domain%/document_errors/;
  42. }
  43. location ~* "/\.(htaccess|htpasswd)$" {
  44. deny all;
  45. return 404;
  46. }
  47. location /vstats/ {
  48. alias %home%/%user%/web/%domain%/stats/;
  49. include %home%/%user%/web/%domain%/stats/auth.conf*;
  50. }
  51. include /etc/nginx/conf.d/phpmyadmin.inc*;
  52. include /etc/nginx/conf.d/phppgadmin.inc*;
  53. include /etc/nginx/conf.d/webmail.inc*;
  54. include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
  55. }