30 lines
1008 B
Nginx Configuration File
30 lines
1008 B
Nginx Configuration File
server {
|
|
listen 9000;
|
|
server_name _;
|
|
|
|
index index.php;
|
|
root /var/www/html;
|
|
|
|
location ~ \.php(.*)$ {
|
|
fastcgi_pass php:9000;
|
|
include fastcgi_params;
|
|
fastcgi_param PATH_INFO $1;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
}
|
|
|
|
location / {
|
|
if (!-e $request_filename) {
|
|
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
|
|
rewrite ^(.*)$ /index.php?s=$1 last;
|
|
break;
|
|
}
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
return 204;
|
|
}
|
|
}
|
|
} |