Guest User

Untitled

a guest
Oct 25th, 2023
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  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.  
  10. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  11.  
  12. location = /favicon.ico {
  13. log_not_found off;
  14. access_log off;
  15. }
  16.  
  17. location = /robots.txt {
  18. try_files $uri $uri/ /index.php?$args;
  19. log_not_found off;
  20. access_log off;
  21. }
  22.  
  23. location ~ /\.(?!well-known\/) {
  24. deny all;
  25. return 404;
  26. }
  27.  
  28. location / {
  29. try_files $uri $uri/ /index.php?$args;
  30.  
  31. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  32. expires 30d;
  33. fastcgi_hide_header "Set-Cookie";
  34. }
  35.  
  36.  
  37. location ~* /(?:uploads|files)/.*.php$ {
  38. deny all;
  39. return 404;
  40. }
  41.  
  42. location ~ [^/]\.php(/|$) {
  43. try_files $uri =404;
  44.  
  45. include /etc/nginx/fastcgi_params;
  46.  
  47. fastcgi_index index.php;
  48. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  49.  
  50. fastcgi_pass %backend_lsnr%;
  51.  
  52. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  53.  
  54. if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
  55. set $no_cache 1;
  56. }
  57.  
  58. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
  59. set $no_cache 1;
  60. }
  61. }
  62. }
  63.  
  64. location /error/ {
  65. alias %home%/%user%/web/%domain%/document_errors/;
  66. }
  67.  
  68. location /vstats/ {
  69. alias %home%/%user%/web/%domain%/stats/;
  70. include %home%/%user%/web/%domain%/stats/auth.conf*;
  71. }
  72.  
  73. location ~ /f/ {
  74. add_header X-Robots-Tag "noindex, nofollow";
  75. try_files $uri $uri/ /index.php$is_args$args;
  76. }
  77.  
  78. include /etc/nginx/conf.d/phpmyadmin.inc*;
  79. include /etc/nginx/conf.d/phppgadmin.inc*;
  80. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  81. }
Add Comment
Please, Sign In to add comment