39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
index index.php index.html;
|
|
error_log /var/log/nginx/error.log;
|
|
access_log /var/log/nginx/access.log;
|
|
root /var/www;
|
|
index index.php index.html;
|
|
|
|
location / {
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE, HEAD';
|
|
add_header 'Access-Control-Max-Age' '1728000';
|
|
add_header 'Access-Control-Allow-Headers' '*';
|
|
#add_header 'Content-Type: text/plain; charset=UTF-8';
|
|
#add_header 'Content-Length: 0';
|
|
return 204;
|
|
}
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
|
|
}
|
|
location ~ \.php$ {
|
|
fastcgi_index index.php;
|
|
fastcgi_pass app:9000;
|
|
|
|
include fastcgi_params;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
}
|
|
location ~* \.(css|less|js|jpg|png|gif)$ {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header Pragma "no-cache";
|
|
expires 0;
|
|
}
|
|
|
|
} |