-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.dist.conf
118 lines (92 loc) · 3 KB
/
nginx.dist.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Example nginx configuration for forkbb
#
server {
listen 80; # 80 port only http:
server_name forkbb.local *.forkbb.local; # you need to set your values
root "/www/forkbb/public"; # you need to set your values
autoindex off;
charset utf-8;
server_tokens off;
location = /favicon.ico {
access_log off;
log_not_found off;
expires 1w;
etag off;
}
location = /robots.txt {
access_log off;
log_not_found off;
}
location / {
fastcgi_hide_header X-Powered-By;
fastcgi_index index.dist.php;
include fastcgi_params;
fastcgi_param HTTP_PROXY "";
#fastcgi_param SCRIPT_FILENAME $document_root/index.dist.php;
fastcgi_param SCRIPT_FILENAME $realpath_root/index.dist.php;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_pass php_upstream; # you need to set your values
#or fastcgi_pass unix:/var/run/php-fpm.sock; # you need to set your values
}
location /js/ {
location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
try_files $1.$2 =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
location ~ /\.ht {
return 404;
}
location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
try_files $uri =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
}
location /img/ {
location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
try_files $1.$2 =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
location ~ /\.ht {
return 404;
}
location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
try_files $uri =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
}
location /style/ {
location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
try_files $1.$2 =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
location ~ /\.ht {
return 404;
}
location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
try_files $uri =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
}
location /upload/ {
location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
try_files $1.$2 =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
location ~ /\.ht {
return 404;
}
location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
try_files $uri =404;
add_header Cache-Control "public,max-age=31536000,immutable";
etag off;
}
}
}