Advertisement
cdelphi78

Untitled

Oct 7th, 2022
1,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         listen [::]:80;
  4.  
  5.         root /var/www/servicedesk/html;
  6.         index index.html index.php index.htm index.nginx-debian.html;
  7.  
  8.         server_name 192.168.4.180 www.servicedesk;
  9.  
  10.         location / {
  11.         if (-f $document_root/reconstruction.html) {
  12.             return 503;
  13.         }
  14.    
  15.         try_files $uri $uri/ =404;
  16.  
  17.     }
  18.  
  19.     error_page 503 = @maintenance;
  20.         location @maintenance {
  21.             if ($remote_addr !~ "^192.168.4.64"){
  22.                 rewrite ^(.*)$ /reconstruction.html break;
  23.             }
  24.         if ($remote_addr !~ "^192.168.4.19"){
  25.         rewrite ^(.*)$ /reconstruction.html break;
  26.         }
  27.         if ($remote_addr !~ "^192.168.4.18"){
  28.         rewrite ^(.*)$ /reconstruction.html break;
  29.         }
  30.     }
  31.  
  32.     location ~ \.php$ {
  33.             include snippets/fastcgi-php.conf;
  34.             fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  35.         }
  36.  
  37.         location ~ /\.ht {
  38.             deny all;
  39.         }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement