nginx拒绝访问
<code>前两天开了个aws免费一年的EC2,我就想买个域名搭个自己的博客练练手。前期都很顺利,可是在绑定域名的时候遇到了麻烦,访问网站时灵时不灵,日志里也看不到不出什么问题。折腾一天了也没什么进展,求各位大神救救俺。 下面是nginx.conf的内容,我还没有配虚拟主机。</code>
<code>user www; worker_processes 1; error_log /opt/modules/nginx/logs/error.log notice; #error_log logs/error.log notice; #error_log logs/error.log info; pid /opt/modules/nginx/logs/nginx.pid; events { use epoll; worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /opt/modules/nginx/logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80 default; #charset koi8-r; access_log /opt/modules/nginx/logs/access.log main; location / { root html; index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } } }</code>
<code>日志里没有打印错误,我这里贴下浏览器报错吧: </code>
<code> 这个错误诡异在日志没有任何的报错,而且不同的浏览器访问网站情况还不一样。我用chrome访问的时候大概有十分之一的几率访问正常,用Safari的时候却有百分之50的几率访问正常,用IE压根不能正常访问。 网站地址是:http://gaochao.info </code>
<code>如果访问正常的话会显示nginx欢迎界面。大家也可以试试。 期初我怀疑是域名没能够正常解析,但后来我排除了这个可能。原因有两点:第一我试过直接修改hosts文件,问题没有任何改善。第二我在ping域名的时候: </code>
<code>这里显示域名已经被成功解析到我的ip了。所以应该不是解析的问题。 我已经试了各种方法了,还是没能解决这个问题。恳请各位大神救我脱离苦海啊!!!</code>
回复内容:
<code>前两天开了个aws免费一年的EC2,我就想买个域名搭个自己的博客练练手。前期都很顺利,可是在绑定域名的时候遇到了麻烦,访问网站时灵时不灵,日志里也看不到不出什么问题。折腾一天了也没什么进展,求各位大神救救俺。 下面是nginx.conf的内容,我还没有配虚拟主机。</code>
<code>user www; worker_processes 1; error_log /opt/modules/nginx/logs/error.log notice; #error_log logs/error.log notice; #error_log logs/error.log info; pid /opt/modules/nginx/logs/nginx.pid; events { use epoll; worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /opt/modules/nginx/logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80 default; #charset koi8-r; access_log /opt/modules/nginx/logs/access.log main; location / { root html; index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } } }</code>
<code>日志里没有打印错误,我这里贴下浏览器报错吧: </code>
<code> 这个错误诡异在日志没有任何的报错,而且不同的浏览器访问网站情况还不一样。我用chrome访问的时候大概有十分之一的几率访问正常,用Safari的时候却有百分之50的几率访问正常,用IE压根不能正常访问。 网站地址是:http://gaochao.info </code>
<code>如果访问正常的话会显示nginx欢迎界面。大家也可以试试。 期初我怀疑是域名没能够正常解析,但后来我排除了这个可能。原因有两点:第一我试过直接修改hosts文件,问题没有任何改善。第二我在ping域名的时候: </code>
<code>这里显示域名已经被成功解析到我的ip了。所以应该不是解析的问题。 我已经试了各种方法了,还是没能解决这个问题。恳请各位大神救我脱离苦海啊!!!</code>
其实看到连接被重置,99%就是被墙了!
AWS被墙了,你需要用代理才能访问。
我在东京, 使用chrome和safari均可以正常访问http://gaochao.info和http://52.196.247.234/
我使用IP Location查了一下你的IP(52.196.247.234), 地址在日本东京。我觉得网站间歇性抽风大概是因为被墙了...
换用国内云服务吧。或者使用Hexo搭建博客, 部署到Coding上, 完全免费, 且非常方便。
被墙了,翻墙可以访问。

熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

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

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

PHP主要是過程式編程,但也支持面向對象編程(OOP);Python支持多種範式,包括OOP、函數式和過程式編程。 PHP適合web開發,Python適用於多種應用,如數據分析和機器學習。

PHP適合網頁開發和快速原型開發,Python適用於數據科學和機器學習。 1.PHP用於動態網頁開發,語法簡單,適合快速開發。 2.Python語法簡潔,適用於多領域,庫生態系統強大。

Linux系統的五個基本組件是:1.內核,2.系統庫,3.系統實用程序,4.圖形用戶界面,5.應用程序。內核管理硬件資源,系統庫提供預編譯函數,系統實用程序用於系統管理,GUI提供可視化交互,應用程序利用這些組件實現功能。

PHP起源於1994年,由RasmusLerdorf開發,最初用於跟踪網站訪問者,逐漸演變為服務器端腳本語言,廣泛應用於網頁開發。 Python由GuidovanRossum於1980年代末開發,1991年首次發布,強調代碼可讀性和簡潔性,適用於科學計算、數據分析等領域。

PHP適用於Web開發和內容管理系統,Python適合數據科學、機器學習和自動化腳本。 1.PHP在構建快速、可擴展的網站和應用程序方面表現出色,常用於WordPress等CMS。 2.Python在數據科學和機器學習領域表現卓越,擁有豐富的庫如NumPy和TensorFlow。

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

雖然 Notepad 無法直接運行 Java 代碼,但可以通過借助其他工具實現:使用命令行編譯器 (javac) 編譯代碼,生成字節碼文件 (filename.class)。使用 Java 解釋器 (java) 解釋字節碼,執行代碼並輸出結果。

要查看 Git 倉庫地址,請執行以下步驟:1. 打開命令行並導航到倉庫目錄;2. 運行 "git remote -v" 命令;3. 查看輸出中的倉庫名稱及其相應的地址。
