Vue通用配置
以下部分放在 server{} 配置段
root /opt/www;
location /dist/ {
try_files $uri $uri/ /index.html;
}
ruoyi配置
以下部分放在 server{} 配置段
location / {
root /opt/www/ruoyi; #修改为实际路径
try_files $uri $uri/ /index.html;
}
location /prod-api/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Scheme $scheme; #https时需要
proxy_pass http://127.0.0.1:8080/; #修改为实际地址
}
fastadmin配置
以下部分放在 server{} 配置段
root /opt/www/fastadmin; #修改为实际路径
location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
# rewrite ^(.+?\.php)(/.+)$ /$1?s=$2 last; # 如果报模块不存在则添加此语句
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
wordpress配置
以下部分放在 server{} 配置段
root /opt/www/wordpress; #修改为实际路径
location / {
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}