【发布时间】:2020-10-23 20:57:48
【问题描述】:
我在同一个服务器上托管了两个 Laravel 应用程序。
例如。 dev.example.com 和 staging.example.com 这两个站点都提供了可供 VUEJS 站点 devfh.example.com 和 stagingfh.example.com 访问的 API。 这两个站点都运行良好,但是,偶尔/随机我们会在开发站点中获取暂存数据并在暂存站点中获取开发数据。
我们正在使用以下技术栈:
- Apache 3.2.2.2
- PHP 7.3.12
- 适用于 MSSQL 的 AWS RDS(两个数据库开发和暂存在同一个实例上)
- Redis 用于存储会话缓存(我们尝试禁用 Redis 缓存 开发网站问题仍然存在)。
我觉得这可能是 Apache、Redis 或 MSSql 端的缓存问题,或者可能是 PHP OpCode 缓存不确定。
我们不确定如何进一步调试此问题。
Apache 虚拟主机设置
<VirtualHost *:80>
ServerName stagingfh.example.com
DocumentRoot "c:/wamp64/www/staging/frontend/dist"
<Directory "c:/wamp64/www/staging/frontend/dist/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</VirtualHost>
<VirtualHost *:80>
ServerName staging.example.com
DocumentRoot "c:/wamp64/www/staging/backend/public"
<Directory "c:/wamp64/www/staging/backend/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName devfh.example.com
DocumentRoot "c:/wamp64/www/staging/development/dist"
<Directory "c:/wamp64/www/staging/development/dist/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</VirtualHost>
<VirtualHost *:80>
ServerName dev.corigami.com
DocumentRoot "c:/wamp64/www/staging/development/public"
<Directory "c:/wamp64/www/staging/development/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
【问题讨论】:
-
您能否提供更多有关服务器设置和站点部署方式的详细信息?是手动部署还是自动部署?是否有可能正在为一个 API 编译 Vue 代码但部署到错误的域?默认情况下会话应该是分开的,如果域设置正确,我认为浏览器缓存不会成为问题,但是当这种情况发生时,可以尝试在浏览器中进行硬刷新,看看是否可以识别问题?跨度>
-
@Spudly 所有四个站点都配置在 apache 虚拟主机中,两个 VueJs 站点分别编译,冲突随机发生,比如说当我们访问站点时它正在工作我们导航到另一个页面我们得到另一个站点数据,我们再次导航并获得正确的站点数据
-
@Spudly 站点托管在 AWS EC2 Windows 服务器上,其技术堆栈定义为问题
标签: php sql-server laravel apache redis