2014-06-07 52 views
0

我正在開發一個網站,nd新手..最近我添加了一個模塊從我的網站訪問互聯網網站,如使用href =「www.randomsite.com」從一個特定的錨標記。 我點擊它指向「本地主機/ www.randomsite.com」的鏈接而不是純粹的www網站後,我無法訪問href網站及其附加到我的項目主目錄的鏈接。 這裏是nginx.conf,請告訴我要改變的事情,以獲得預期的行動。 在此先感謝。無法訪問http:// www。網站從項目內

user html;

worker_processes 1;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

pid logs/nginx.pid;

事件{

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 logs/access.log main; 



sendfile  on; 

#tcp_nopush  on; 



#keepalive_timeout 0; 

keepalive_timeout 65; 



gzip on; 



server { 

    listen  80; 

    server_name localhost; 

root /home/ranjan/public_html/socialedu/trunk; 

index index.php; 



location/{ 

    rewrite^/index.php?url=$uri last; 

    } 



location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|png|mp4|mp3|ogg)$ { 

    expires max; 

    add_header Pragma public; 

    add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 

} 

location ~ \.php$ { 

    try_files  $uri =404; 

    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 

    fastcgi_index index.php; 

    include  fastcgi.conf; 

} 



    access_log logs/host.access.log main; 



    # redirect server error pages to the static page /50x.html 

    # 

    error_page 500 502 503 504 /50x.html; 

    location = /50x.html { 

     root /usr/share/nginx/html; 

    } 

} 

服務器{

 server_name  phpmyadmin.local; 



    root /usr/share/webapps/phpMyAdmin; 

    index index.php; 



    location ~ \.php$ { 

      try_files  $uri =404; 

      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 

      fastcgi_index index.php; 

      include  fastcgi.conf; 

    } 

}

# another virtual host using mix of IP-, name-, and port-based configuration 

# 

#server { 

# listen  8000; 

# listen  somename:8080; 

# server_name somename alias another.alias; 



# location/{ 

#  root html; 

#  index index.html index.htm; 

# } 

#} 





# HTTPS server 

# 

#server { 

# listen  443; 

# server_name localhost; 



# ssl     on; 

# ssl_certificate  cert.pem; 

# ssl_certificate_key cert.key; 



# ssl_session_timeout 5m; 



# ssl_protocols SSLv2 SSLv3 TLSv1; 

# ssl_ciphers HIGH:!aNULL:!MD5; 

# ssl_prefer_server_ciphers on; 



# location/{ 

#  root html; 

#  index index.html index.htm; 

# } 

#} 

}

回答

0

此無關nginx的。你需要提供一個URI

<a href="http://en.wikipedia.org/wiki/Uniform_resource_identifier">Link</a> 
+0

非常感謝,一個該死的愚蠢的錯誤我承諾..現在workin .. :) – ranjzz