无法访问 http://www。项目内的站点
Posted
技术标签:
【中文标题】无法访问 http://www。项目内的站点【英文标题】:unable to access http://www. sites from within the project 【发布时间】:2014-07-28 08:31:30 【问题描述】:我正在开发一个网站,发现一个新手..最近我从我的网站添加了一个模块来访问互联网站点,例如使用来自特定锚标记的 href="www.randomsite.com"。 在单击指向“localhost/www.randomsite.com”而不是纯 www 站点的链接后,我无法访问 href 站点并将其附加到我的项目主目录中。 这是 nginx.conf,请告诉我要更改的内容以获得预期的操作。 提前致谢。
用户html;
worker_processes 1;
error_log 日志/error.log;
error_log logs/error.log 通知;
error_log 日志/error.log 信息;
pid 日志/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;
#
#
【问题讨论】:
【参考方案1】:这与nginx无关。您需要提供一个 URI
<a href="http://en.wikipedia.org/wiki/Uniform_resource_identifier">Link</a>
【讨论】:
非常感谢,我犯了一个该死的愚蠢错误..它现在正在工作..:)以上是关于无法访问 http://www。项目内的站点的主要内容,如果未能解决你的问题,请参考以下文章
IDEA启动报错,项目无法访问:The APR based Apache Tomcat Native library which allows optimal perfor
无法访问 UITabBar 内的 UITabBarItem(s)