emsanator

Untitled

Dec 24th, 2021 (edited)
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.92 KB | None | 0 0
  1. server {
  2.         listen *:80;
  3.         listen [::]:80;
  4.         listen *:443 ssl http2;
  5.  
  6.     ssl_protocols TLSv1.3 TLSv1.2;
  7.         listen [::]:443 ssl http2;
  8.         ssl_certificate /var/www/clients/client5/web10/ssl/example.com-le.crt;
  9.         ssl_certificate_key /var/www/clients/client5/web10/ssl/example.com-le.key;
  10.  
  11.         server_name example.com www.example.com assets.example.com;
  12.  
  13.         root   /var/www/example.com/web/;
  14.         try_files $uri $uri.html $uri/ @extensionless-php;
  15.         disable_symlinks if_not_owner from=$document_root;
  16.  
  17.         if ($http_host = "assets.example.com") {
  18.             rewrite ^(?!/(_SubDomains/Assets|stats|error|\.well-known/acme-challenge))/(.*)$ /_SubDomains/Assets/$2 last;
  19.         }
  20.  
  21.         index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;
  22.  
  23.  
  24.         error_page 400 /error/400.html;
  25.         error_page 401 /error/401.html;
  26.         error_page 403 /error/403.html;
  27.         error_page 404 /error/404.html;
  28.         error_page 405 /error/405.html;
  29.         error_page 500 /error/500.html;
  30.         error_page 502 /error/502.html;
  31.         error_page 503 /error/503.html;
  32.         recursive_error_pages on;
  33.         location = /error/400.html {
  34.  
  35.             internal;
  36.             auth_basic off;
  37.         }
  38.         location = /error/401.html {
  39.  
  40.             internal;
  41.             auth_basic off;
  42.         }
  43.         location = /error/403.html {
  44.  
  45.             internal;
  46.             auth_basic off;
  47.         }
  48.         location = /error/404.html {
  49.  
  50.             internal;
  51.             auth_basic off;
  52.         }
  53.         location = /error/405.html {
  54.  
  55.             internal;
  56.             auth_basic off;
  57.         }
  58.         location = /error/500.html {
  59.  
  60.             internal;
  61.             auth_basic off;
  62.         }
  63.         location = /error/502.html {
  64.  
  65.             internal;
  66.             auth_basic off;
  67.         }
  68.         location = /error/503.html {
  69.  
  70.             internal;
  71.             auth_basic off;
  72.         }
  73.  
  74.         error_log /var/log/ispconfig/httpd/example.com/error.log;
  75.         access_log /var/log/ispconfig/httpd/example.com/access.log combined;
  76.  
  77.         location ~ /\. {
  78.             deny all;
  79.         }
  80.  
  81.         location ^~ /.well-known/acme-challenge/ {
  82.             access_log off;
  83.             log_not_found off;
  84.             auth_basic off;
  85.             root /usr/local/ispconfig/interface/acme/;
  86.             autoindex off;
  87.             index index.html;
  88.             try_files $uri $uri/ =404;
  89.         }
  90.  
  91.         location = /favicon.ico {
  92.             log_not_found off;
  93.             access_log off;
  94.             expires max;
  95.             add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  96.         }
  97.  
  98.         location = /robots.txt {
  99.             allow all;
  100.             log_not_found off;
  101.             access_log off;
  102.         }
  103.  
  104.         location /stats/ {
  105.  
  106.             index index.html index.php;
  107.             auth_basic "Members Only";
  108.             auth_basic_user_file /var/www/clients/client5/web10/web//stats/.htpasswd_stats;
  109.             add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;";
  110.         }
  111.  
  112.         location ^~ /awstats-icon {
  113.             alias /usr/share/awstats/icon;
  114.         }
  115.  
  116.         location ~ \.php$ {
  117.             try_files /efd21b2c53cdb37eefe329eeb66d64a3.htm @php;
  118.         }
  119.  
  120.         location @php {
  121.             try_files $uri =404;
  122.             include /etc/nginx/fastcgi_params;
  123.             fastcgi_pass unix:/var/lib/php7.4-fpm/web10.sock;
  124.             fastcgi_index index.php;
  125.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  126.             fastcgi_intercept_errors on;
  127.         }
  128.  
  129.         location ~ \.php$ {
  130.             try_files /efd21b2c53cdb37eefe329eeb66d64a3.htm @php;
  131.         }
  132.        
  133.         location @extensionless-php {
  134.             rewrite ^(.*)$ $1.php last;
  135.         }
  136.        
  137. rewrite ^/item/([^/]+)/([^/]+) /index.php?cmd=$1&scd=$2 break;
  138. rewrite ^/item/([^/]+)         /index.php?cmd=$1        break;
  139.  
  140. }
Add Comment
Please, Sign In to add comment