39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
server {
|
|
listen 80 default_server;
|
|
root /var/www/html/public;
|
|
index index index.php;
|
|
server_name localhost;
|
|
|
|
location / {
|
|
try_files $uri /index.php$is_args$args;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
}
|
|
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
|
|
add_header Access-Control-Allow-Origin *;
|
|
expires 5d;
|
|
}
|
|
location ~* \.gz$ {
|
|
expires 5d;
|
|
gzip_static on;
|
|
add_header Content-Encoding gzip;
|
|
gzip off;
|
|
location ~* \.css\.gz$ { types { text/css gz; } }
|
|
location ~* \.js\.gz$ { types { application/javascript gz; } }
|
|
}
|
|
|
|
# Deny access to . files, for security
|
|
location ~ /\. {
|
|
log_not_found off;
|
|
deny all;
|
|
}
|
|
}
|