-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
31 lines (25 loc) · 850 Bytes
/
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
fastcgi_cache_path /tmp/nginx_cache levels=1:2 keys_zone=MYAPP:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
server {
listen 80;
root /var/www/html/public;
location ~* \.(?:css|js|jpg|jpeg|gif|ico|png|svg|woff|woff2)$ {
expires max;
add_header Cache-Control "public";
access_log off;
log_not_found off;
}
location / {
# try to serve file directly, fallback to app.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php-fpm;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_cache MYAPP;
internal;
}
}