forked from Kovah/LinkAce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
57 lines (47 loc) · 1.52 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
49
50
51
52
53
54
55
56
57
server {
root /app/public;
server_name _;
index index.php;
charset utf-8;
client_max_body_size 20M;
port_in_redirect off;
# Choose the connection method
listen 0.0.0.0:8080;
# Content security headers for Laravel
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
# Gzip
gzip on;
gzip_vary on;
gzip_comp_level 8;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private auth;
gzip_types application/javascript application/x-javascript application/xhtml+xml font/woff font/woff2 image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;
# Location configs
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Assets and media files
location ~* \.(?:css|js|map|scss|jpg|jpeg|png|gif|mp4|woff|woff2|ico|svg|webmanifest)$ {
expires max;
access_log off;
add_header Cache-Control "public";
try_files $uri =404;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
# Error pages
error_page 404 /index.php;
error_page 403 /index.php;
# PHP handling
location ~ \.php$ {
fastcgi_pass app:9000;
try_files $uri /index.php;
include fastcgi.conf;
fastcgi_keep_conn on;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_read_timeout 300;
}
}