新增本地开发环境配置
This commit is contained in:
33
nginx.conf
Normal file
33
nginx.conf
Normal file
@@ -0,0 +1,33 @@
|
||||
server {
|
||||
listen 9000;
|
||||
server_name _;
|
||||
|
||||
# CORS
|
||||
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;
|
||||
|
||||
# pre-flight requests
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user