搜尋
首頁後端開發php教程docker內部更新index.html後重啟nginx服務未發現更新

用-p 1334:80 把鏡像 run起來以後,在localhost:1334訪問到了nginx的index頁。
在docker裡用bash互動方式,vim改了nginx的index.html文件,儲存退出,但是重啟服務後看不到效果,貼我的操作流程如下:

<code>root@a79dfceda4d9:/usr/sbin# killall nginx        --关掉服务
root@a79dfceda4d9:/usr/sbin# ps -aux|grep nginx
warning: bad ps syntax, perhaps a bogus '-'?    
See                                     --已经看不到master         http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
root       156  0.0  0.0   6328   488 ?        S+   06:33   0:00 grep nginx
root@a79dfceda4d9:/usr/sbin# nginx        --重新启动
root@a79dfceda4d9:/usr/sbin# ps -aux|grep nginx
warning: bad ps syntax, perhaps a bogus '-'?
See                                    --又看到了http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
root       158  0.0  0.0  64428  2996 ?        Ss   06:33   0:00 nginx: master process nginx
www-data   159  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   160  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   161  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   162  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
root       164  0.0  0.0   6328   560 ?        S+   06:33   0:00 grep nginx
</code>

這時再去訪問映射出來的localhost:1334,頁面沒變化? ? ?
不太理解,望大家指點一二。

回覆內容:

用-p 1334:80 把鏡像 run起來以後,在localhost:1334訪問到了nginx的index頁。
在docker裡用bash互動方式,vim改了nginx的index.html文件,儲存退出,但是重啟服務後看不到效果,貼我的操作流程如下:

<code>root@a79dfceda4d9:/usr/sbin# killall nginx        --关掉服务
root@a79dfceda4d9:/usr/sbin# ps -aux|grep nginx
warning: bad ps syntax, perhaps a bogus '-'?    
See                                     --已经看不到master         http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
root       156  0.0  0.0   6328   488 ?        S+   06:33   0:00 grep nginx
root@a79dfceda4d9:/usr/sbin# nginx        --重新启动
root@a79dfceda4d9:/usr/sbin# ps -aux|grep nginx
warning: bad ps syntax, perhaps a bogus '-'?
See                                    --又看到了http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
root       158  0.0  0.0  64428  2996 ?        Ss   06:33   0:00 nginx: master process nginx
www-data   159  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   160  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   161  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
www-data   162  0.0  0.0  64828  3580 ?        S    06:33   0:00 nginx: worker process
root       164  0.0  0.0   6328   560 ?        S+   06:33   0:00 grep nginx
</code>

這時再去訪問映射出來的localhost:1334,頁面沒變化? ? ?
不太理解,望大家指點一二。

nginx快取也是有可能的,一般解析過去並不是立刻生效把。

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
如何使PHP應用程序更快如何使PHP應用程序更快May 12, 2025 am 12:12 AM

tomakephpapplicationsfaster,關注台詞:1)useopcodeCachingLikeLikeLikeLikeLikePachetoStorePreciledScompiledScriptbyTecode.2)MinimimiedAtabaseSqueriSegrieSqueriSegeriSybysequeryCachingandeffeftExting.3)Leveragephp7 leveragephp7 leveragephp7 leveragephpphp7功能forbettercodeefficy.4)

PHP性能優化清單:立即提高速度PHP性能優化清單:立即提高速度May 12, 2025 am 12:07 AM

到ImprovephPapplicationspeed,關注台詞:1)啟用opcodeCachingwithapCutoredUcescriptexecutiontime.2)實現databasequerycachingingusingpdotominiminimizedatabasehits.3)usehttp/2tomultiplexrequlexrequestsandreduceconnection.4 limitesclection.4.4

PHP依賴注入:提高代碼可檢驗性PHP依賴注入:提高代碼可檢驗性May 12, 2025 am 12:03 AM

依赖注入(DI)通过显式传递依赖关系,显著提升了PHP代码的可测试性。1)DI解耦类与具体实现,使测试和维护更灵活。2)三种类型中,构造函数注入明确表达依赖,保持状态一致。3)使用DI容器管理复杂依赖,提升代码质量和开发效率。

PHP性能優化:數據庫查詢優化PHP性能優化:數據庫查詢優化May 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

簡單指南:帶有PHP腳本的電子郵件發送簡單指南:帶有PHP腳本的電子郵件發送May 12, 2025 am 12:02 AM

phpisusedforsenderemailsduetoitsbuilt-inmail()函數andsupportivelibrariesLikePhpMailerAndSwiftMailer.1)usethemail()functionForbasiceMails,butithasimails.2)butithasimail.2)

PHP性能:識別和修復瓶頸PHP性能:識別和修復瓶頸May 11, 2025 am 12:13 AM

PHP性能瓶颈可以通过以下步骤解决:1)使用Xdebug或Blackfire进行性能分析,找出问题所在;2)优化数据库查询并使用缓存,如APCu;3)使用array_filter等高效函数优化数组操作;4)配置OPcache进行字节码缓存;5)优化前端,如减少HTTP请求和优化图片;6)持续监控和优化性能。通过这些方法,可以显著提升PHP应用的性能。

PHP的依賴注入:快速摘要PHP的依賴注入:快速摘要May 11, 2025 am 12:09 AM

依賴性注射(DI)InphpisadesignPatternthatManages和ReducesClassDeptions,增強量強制性,可驗證性和MATIALWINABIOS.ItallowSpasspassingDepentenciesLikEdenciesLikedAbaseConnectionStoclasseconnectionStoclasseSasasasasareTers,interitationAseTestingEaseTestingEaseTestingEaseTestingEasingAndScalability。

提高PHP性能:緩存策略和技術提高PHP性能:緩存策略和技術May 11, 2025 am 12:08 AM

cachingimprovesphpermenceByStorcyResultSofComputationsorqucrouctationsorquctationsorquickretrieval,reducingServerLoadAndenHancingResponsetimes.feftectivestrategiesinclude:1)opcodecaching,whereStoresCompiledSinmememorytssinmemorytoskipcompliation; 2)datacaching datacachingsingMemccachingmcachingmcachings

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。

MantisBT

MantisBT

Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。