docker-compose.yml 被清空导致前端退出、后端 .env 挂载失效;从 git 历史与镜像反编译重建全套 Docker 配置,修复 nginx 登录重写走 ThinkPHP 路由。 Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /var/www/html/public;
|
|
index index.php index.html;
|
|
|
|
add_header Access-Control-Allow-Origin * always;
|
|
add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS' always;
|
|
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Token,X-Token' always;
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
return 204;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ @rewrite;
|
|
}
|
|
location @rewrite {
|
|
rewrite ^(.*)$ /index.php?s=$1 last;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
fastcgi_read_timeout 300;
|
|
}
|
|
|
|
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
|
|
location ~ ^/(application|thinkphp|vendor|runtime)/ {
|
|
deny all;
|
|
}
|
|
}
|