1
0

site.conf 891 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. server {
  2. listen 80;
  3. server_name vpn.example.com;
  4. root /var/www/vpn;
  5. index index.php;
  6. access_log /var/log/nginx/vpn-access.log;
  7. error_log /var/log/nginx/vpn-error.log;
  8. location / {
  9. try_files $uri $uri/ /index.php?$args;
  10. }
  11. # PHP
  12. location ~ \.php$ {
  13. include snippets/fastcgi-php.conf;
  14. fastcgi_pass unix:/run/php/php8.4-fpm.sock;
  15. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  16. }
  17. # запрет листинга
  18. autoindex off;
  19. # admin auth
  20. location /admin {
  21. auth_basic "VPN Admin";
  22. auth_basic_user_file /etc/nginx/.htpasswd-admin;
  23. try_files $uri $uri/ /index.php?$args;
  24. }
  25. # ccd auth
  26. location /ccd {
  27. auth_basic "VPN User";
  28. auth_basic_user_file /etc/nginx/.htpasswd-ccd;
  29. try_files $uri $uri/ /index.php?$args;
  30. }
  31. }