-
Notifications
You must be signed in to change notification settings - Fork 0
/
vhost.conf
44 lines (34 loc) · 1.3 KB
/
vhost.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
## /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
# Set root
root /var/www/html;
index index.php public/index.php index.html index.htm index.nginx-debian.html;
charset utf-8;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri public/$uri /index.php?$query_string $uri/ =404;
}
# pass PHP scripts to FastCGI server
location ~ \.php$ {
# With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
# With php-cgi (or other tcp sockets):
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht {
deny all;
}
location ~ /\.(?!well-known).* {
deny all;
}
}