-
Notifications
You must be signed in to change notification settings - Fork 0
/
php-stv_prod.conf
35 lines (28 loc) · 994 Bytes
/
php-stv_prod.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
# this file should be copied to /etc/nginx/sites-available/php-stv on the production server
server {
# main site
listen 80;
server_name stv-results.theodorejb.me;
root /var/www/php-stv/public;
index index.html index.php;
gzip on;
gzip_types text/css application/javascript image/svg+xml image/x-icon application/json;
location / {
# First attempt to serve request as file, then as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
error_page 404 /404.php;
# cache static files and avoid logging them
location ~* .(ico|svg|jpg|png|js|css|woff)$ {
expires 1M;
access_log off;
}
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}