當前位置:首頁 » 密碼管理 » ip無法訪問nginx

ip無法訪問nginx

發布時間: 2024-10-10 14:17:03

『壹』 nginx非80埠配置 外網無法訪問

檢查一下防火牆的設置。
如果是linux的話,看看iptable是否授權了80埠,或者乾脆關閉iptable

『貳』 雲伺服器安裝nginx為什麼通過公有ip不能訪問文件

以下是小鳥雲官網整理的:
If you do not want to process requests with undefined "Host" header lines, you may define a default server that just drops the requests:

復制代碼 代碼如下:

server {
listen 80 default_server;
server_name _;
return 444;
}

說白了就是只要是訪客用ip訪問就直接重置444錯誤。但是這樣好像又不太友好,如果能直接給跳轉到該web server的網址就好了。配置如下:

復制代碼 代碼如下:

server {
listen 80 default_server;
server_name _;
rewrite ^ http://www.domain.com$request_uri?;
}

這樣還是有一點問題,某些特別的地址,我需要用ip訪問,其他的都禁止,如何配置呢?比如說我想讓監控寶直接用ip訪問我的機器的nginx狀態信息,其他的用ip訪問的所有請求都跳轉到域名上。

復制代碼 代碼如下:

server {
listen 80 default_server;
server_name _;
location /xxxxx{
stub_status on;
access_log off;
}
location /{
rewrite ^ http://www.domain.com$request_uri?;
}
}

這樣就實現了我們想要的功能了。

『叄』 我的ip用curl請求網站的時候報nginx 403錯誤,訪問其它網站可以,其它ip也可以訪問,就我不可以

從你的描述上看,是網站管理員限制了你訪問的許可權,你沒有辦法處理,需要到網站機器上設置WEB伺服器。

『肆』 nginx配置了負載均衡的訪問ip地址過後,那個ip地址不能訪問

報錯的url鏈接是:http://test/,把這個域名調通就能訪問了,如果僅僅只是配置php的話,建議配置php支持:

location~.*.(php|php5)?$
{
fastcgi_pass127.0.0.1:9000;//根據自己的fast_cgi監聽進行更改
fastcgi_indexindex.php;
includefastcgi.conf;
}
熱點內容
演算法第 發布:2025-03-14 04:40:56 瀏覽:225
天選2什麼配置好 發布:2025-03-14 03:37:17 瀏覽:285
魅族手機怎麼找回密碼 發布:2025-03-14 02:35:48 瀏覽:296
配置高低主要看什麼 發布:2025-03-14 01:49:22 瀏覽:86
locpython 發布:2025-03-14 01:12:50 瀏覽:344
java數組的定義方法 發布:2025-03-14 00:53:25 瀏覽:519
壓縮性綳帶 發布:2025-03-14 00:30:21 瀏覽:185
如何給樹莓派編譯適合的軟體 發布:2025-03-14 00:29:45 瀏覽:377
c語言編譯器雲盤鏈接 發布:2025-03-14 00:25:23 瀏覽:350
電腦上哪個游戲可以移植到安卓上 發布:2025-03-14 00:10:32 瀏覽:475