SHARE
TWEET

nginx vhost file

ovizii Oct 29th, 2016 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.         listen *:80;
  3.      if ( $is_bot ) {
  4.          return 444;
  5.      }
  6.     more_set_headers 'Server: my-server';
  7.  
  8.         server_name die-kellerkinder.eu www.die-kellerkinder.eu;
  9.  
  10.         root   /var/www/die-kellerkinder.eu/web/;
  11.  
  12.  
  13.  
  14.         index index.html index.htm index.php index.cgi index.pl index.xhtml;
  15.  
  16.  
  17.  
  18.         error_log /var/log/ispconfig/httpd/die-kellerkinder.eu/error.log;
  19.         access_log /var/log/ispconfig/httpd/die-kellerkinder.eu/access.log combined buffer=32k;
  20.  
  21.         location ~ /\.(?!well-known/acme-challenge/) {
  22.             deny all;
  23.             access_log off;
  24.             log_not_found off;
  25.         }
  26.  
  27.         location = /favicon.ico {
  28.             log_not_found off;
  29.             access_log off;
  30.         }
  31.  
  32.         location = /robots.txt {
  33.             allow all;
  34.             log_not_found off;
  35.             access_log off;
  36.         }
  37.  
  38.         location /stats {
  39.  
  40.             index index.html index.php;
  41.             auth_basic "Members Only";
  42.             auth_basic_user_file /var/www/clients/client1/web4/web/stats/.htpasswd_stats;
  43.         }
  44.  
  45.         location ^~ /awstats-icon {
  46.             alias /usr/share/awstats/icon;
  47.         }
  48.  
  49.         location ~ \.php$ {
  50.             try_files /de0d9873ff9f0930cf019a30c4b944d6.htm @php;
  51.         }
  52.  
  53.         location @php {
  54.             try_files $uri =404;
  55.             include /etc/nginx/fastcgi_params;
  56.             fastcgi_pass unix:/var/lib/php5-fpm/web4.sock;
  57.             fastcgi_index index.php;
  58.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  59.             fastcgi_intercept_errors on;
  60.             fastcgi_buffer_size 128k;
  61.             fastcgi_buffers 256 16k;
  62.             fastcgi_busy_buffers_size 256k;
  63.             fastcgi_temp_file_write_size 256k;
  64.             fastcgi_read_timeout 3000;
  65.         }
  66.         location /webmail {
  67.                root /var/www/;
  68.                index index.php index.html index.htm;
  69.                location ~ ^/webmail/(.+\.php)$ {
  70.                        try_files $uri =404;
  71.                        root /var/www/;
  72.                        fastcgi_pass 127.0.0.1:9000;
  73.                        fastcgi_index index.php;
  74.                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  75.                        include /etc/nginx/fastcgi_params;
  76.                        fastcgi_buffer_size 128k;
  77.                        fastcgi_buffers 256 4k;
  78.                        fastcgi_busy_buffers_size 256k;
  79.                        fastcgi_temp_file_write_size 256k;
  80.                        fastcgi_intercept_errors on;
  81.                }
  82.                location ~* ^/webmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  83.                        root /var/www/;
  84.                }
  85.         }
  86.  
  87.  
  88.         location / {
  89.         try_files $uri $uri/ /index.html /index.php?$args;
  90.         }
  91.  
  92.         location ~* \.(jpg|jpeg|png|gif|ico|pdf|woff|css|js)$ {
  93.            expires 7d;
  94.            add_header Cache-Control public;
  95.         }
  96.  
  97.         pagespeed RewriteLevel CoreFilters;
  98.         pagespeed EnableFilters collapse_whitespace,insert_dns_prefetch,move_css_to_head,move_css_above_scripts,rewrite_style_attributes,defer_javascript,insert_image_dimensions,sprite_images,prioritize_critical_css,inline_google_font_css,lazyload_images;
  99.         pagespeed Disallow *wp-admin/*;
  100.         pagespeed Disallow *wp-login.php*;
  101.         location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
  102. add_header "" "";
  103.         }
  104.  
  105. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top