Advertisement
Guest User

Untitled

a guest
May 6th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.83 KB | None | 0 0
  1. upstream php-handler {
  2.     server unix:/var/run/php/php7.0-fpm.sock;
  3. }
  4.  
  5. server {
  6.     if ($host = myhumbleplace.com) {
  7.         return 301 https://$host$request_uri;
  8.     }
  9.  
  10.     listen 80;
  11.     listen [::]:80;
  12.     server_name myhumbleplace.com;
  13.  
  14.     return 301 https://$server_name$request_uri;
  15. }
  16.  
  17. server {
  18.     listen 443 ssl http2;
  19.     listen [::]:443 ssl http2;
  20.    
  21.     server_name myhumbleplace.com;
  22.    
  23.     add_header X-Content-Type-Options nosniff;
  24.     add_header X-XSS-Protection "1; mode=block";
  25.     add_header X-Robots-Tag none;
  26.     add_header X-Download-Options noopen;
  27.     add_header X-Permitted-Cross-Domain-Policies none;
  28.     add_header Referrer-Policy no-referrer;
  29.  
  30.     fastcgi_hide_header X-Powered-By;
  31.  
  32.     root /var/www/html;
  33.    
  34.     index index.php index.html;
  35.    
  36.     location = /robots.txt {
  37.         allow all;
  38.         log_not_found off;
  39.         access_log off;
  40.     }
  41.  
  42.     location / {
  43.         try_files $uri $uri/ /sites/bl/index.php$is_args$args =404;
  44.     }
  45.  
  46.     location /sites {
  47.         alias /var/www/sites;
  48.     }
  49.    
  50.     location ~ ^/sites/foo {
  51.         alias /var/www/sites/foo;
  52.         try_files $uri $uri/ /index.php$is_args$args =404;
  53.         include fastcgi.conf;
  54.         include fastcgi_params;
  55.         fastcgi_pass php-handler;
  56.     }
  57.    
  58.     location ~ ^/sites/foo/((delme|config|content|vendor|composer\.(json|lock|phar))(/|$)|(.+/)?\.(?!well-known(/|$))) {
  59.         root /var/www/sites/foo;
  60.         try_files /sites/foo/index.php$is_args$args =404;
  61.     }
  62.  
  63.     location ~ \.php$ {
  64.         try_files $uri =404;
  65.  
  66.         include fastcgi.conf;
  67.         fastcgi_pass php-handler;
  68.     }
  69.  
  70.     ssl_certificate /etc/letsencrypt/live/myhumbleplace.com/fullchain.pem; # managed by Certbot
  71.     ssl_certificate_key /etc/letsencrypt/myhumbleplace.com/privkey.pem; # managed by Certbot
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement