2025-09-12 22:10:52
$ cat /etc/nginx/http.d/default.conf
server {
listen 80;
server_name localhost;
charset utf-8;
root /var/www/html;
index index.php editor.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /tmp/ {
alias /inter/tmp/;
autoindex on;
autoindex_exact_size off; # Показывать размеры в удобочитаемом формате
autoindex_localtime on; # Показывать время по локальному часовому поясу
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index editor.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(css|js|jpg|jpeg|png|gif|ico|woff|woff2|ttf|svg|eot)$ {
expires max;
log_not_found off;
}
location = /editor.php {
auth_basic "Password";
auth_basic_user_file /etc/nginx/.htpasswd;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Back to list