nginx 虛擬主機問題
nginx 虛擬主機問題
最近配了個nginx測試環境,發現個問題,訪問www.test.com:4545 后,點擊其他頁面會跳轉到www.test.com的頁面去,正常來說應該跳轉到www.test.com:4545 的頁面去。求解答
虛擬主機配置如下server {
listen 4545;
server_name www.test.com ;
index index.html index.php;
root /data/www_test/;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
allow 124.22.39.11;
deny all;
}
access_log /usr/local/nginx/logs/www_test_access.log combined;
}
《解決方案》
跟nginx沒有關係,是你程序的問題。如果想用非80的埠的話,你程序在生成url的時候要加上埠號的。