Advertisement
emsanator

Untitled

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