| 123456789101112131415161718192021222324252627282930313233343536373839 |
- server {
- listen 80;
- server_name vpn.example.com;
- root /var/www/vpn;
- index index.php;
- access_log /var/log/nginx/vpn-access.log;
- error_log /var/log/nginx/vpn-error.log;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- # PHP
- location ~ \.php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/run/php/php8.4-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- # запрет листинга
- autoindex off;
- # admin auth
- location /admin {
- auth_basic "VPN Admin";
- auth_basic_user_file /etc/nginx/.htpasswd-admin;
- try_files $uri $uri/ /index.php?$args;
- }
- # ccd auth
- location /ccd {
- auth_basic "VPN User";
- auth_basic_user_file /etc/nginx/.htpasswd-ccd;
- try_files $uri $uri/ /index.php?$args;
- }
- }
|