Advertisement
Cepita

Untitled

Jul 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. server {
  2.  
  3. listen 80;
  4. listen 443 ssl http2;
  5. server_name forum.example.com;
  6. root /var/www/vanilla;
  7. index index.php;
  8.  
  9. # RSA
  10. ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;
  11. ssl_certificate_key /etc/letsencrypt/example.com/private.key;
  12. # ECC
  13. ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;
  14. ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;
  15.  
  16. location ~* /\.git { deny all; return 403; }
  17. location /build/ { deny all; return 403; }
  18. location /cache/ { deny all; return 403; }
  19. location /cgi-bin/ { deny all; return 403; }
  20. location /uploads/import/ { deny all; return 403; }
  21. location /conf/ { deny all; return 403; }
  22. location /tests/ { deny all; return 403; }
  23. location /vendor/ { deny all; return 403; }
  24.  
  25. location ~* ^/index\.php(/|$) {
  26. include snippets/fastcgi-php.conf;
  27. fastcgi_param SCRIPT_NAME /index.php;
  28. fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
  29. fastcgi_param X_REWRITE 1;
  30. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  31. }
  32.  
  33. location ~* \.php(/|$) {
  34. rewrite ^ /index.php$uri last;
  35. }
  36.  
  37. location / {
  38. try_files $uri $uri/ @vanilla;
  39. }
  40.  
  41. location @vanilla {
  42. rewrite ^ /index.php$uri last;
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement