-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
48 lines (38 loc) · 1.16 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
server {
listen 80;
listen [::]:80;
server_name class.helpacademy.uz;
root /home/gibbon/core;
index index.php index.html index.htm;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
autoindex off;
}
location /uploads/ {
autoindex off; # Disable directory listing
# Allow access to specific file types
location ~* ^/uploads/.*\.(jpg|jpeg|png|gif|pdf|doc|docx)$ {
allow all;
}
# Deny all other access
location /uploads/ {
deny all;
}
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/class.helpacademy.uz-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.(?!well-known).* {
deny all;
}
}