当前位置: 首页> 文旅> 酒店 > 网络系统集成_引流推广方案_百度收录入口提交查询_google官网浏览器

网络系统集成_引流推广方案_百度收录入口提交查询_google官网浏览器

时间:2025/7/10 12:00:05来源:https://blog.csdn.net/whf1215847706/article/details/145029661 浏览次数:0次
网络系统集成_引流推广方案_百度收录入口提交查询_google官网浏览器

新项目采用前后端分离的方式开发,前后端代码打算分开部署(同机器且同域名),但打算支持后端依然可访问静态资源(nginx配置仅一份)。

搜索nginx配置大部分都通过url前缀进行转发来做前后端分离,不适用目前项目。

说明

前端框架:vue

后端框架:thinkphp6

前端部署目录:/www/project_static

后端部署目录:/www/project

nginx配置方式 

`api`及`static`转发到php
server {listen 80;server_name test.aichenk.com;index index.html index.htm index.php;set $static_root '/www/project_static';set $php_root '/www/project/public';root $static_root;location ~ \.php$ {root $php_root;fastcgi_pass   127.0.0.1:9000;fastcgi_index  index.php;fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;include        fastcgi_params;fastcgi_buffer_size 128k;fastcgi_buffers 32 32k;}location / {try_files $uri $uri/ /index.html;}location ^~ /api/ {root $php_root;if (!-e $request_filename) {rewrite  ^(.*)$  /index.php?s=/$1  last;break;}}location ^~ /static/ {root $php_root;access_log off;}# 禁用缓存location = /index.html {add_header Cache-Control no-cache;add_header Pragma no-cache;add_header Expires 0;}location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {expires       max;log_not_found off;access_log    off;}
}

另外可通过反向代理方式,若第一次判断文件不存在,则发送到另一个服务中,服务中仅关注后端配置。

关键字:网络系统集成_引流推广方案_百度收录入口提交查询_google官网浏览器

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: