公司服务器做了内外网之分,外网不能通过ip访问,做了内网穿透,通过域名+开放端口访问,由nginx监听,现在有个问题就是域名解析只能用隐性url,但是nginx只能访问首页,地址后面跟的地址无法解析,怎么办,
比如      followme.gfline.com/partner-recruitment.html 
直接解析了   followme.gfline.com  跳到了首页,而后面的  partner-recruitment.html   没效果。

解决方案 »

  1.   

    nginx 配置可否贴出来看一下,多半是nginx配置错误
      

  2.   

    server { 
      listen 8087; 
      server_name followme.gfline.com; 
      
      index index.html index.htm;  location / {
      
            proxy_pass http://followme.gfline.com:8111/;


       } location /.(htm|html|map|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ { 
         proxy_pass http://followme.gfline.com:8111/;
         root  "/var/www/html/followme/public";
      #  try_files $uri $uri/ /index.php?$query_string;
         try_files $uri $uri/ /index.html =404;
      #  proxy_redirect  off; 
      #  proxy_set_header   Host $host; 
      #  proxy_set_header   X-Real-IP $remote_addr; 
      #  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
      #  proxy_pass http://branch.followme.org:8011; 
       }
      
      location ~ .*\.(htm|html|map|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ { 
           root  "/var/www/html/followme/public";
          # try_files $uri $uri/ /index.php?$query_string;
           try_files $uri $uri/ /index.html =404;
        #  proxy_redirect  off; 
        #  proxy_set_header   Host $host; 
        #  proxy_set_header   X-Real-IP $remote_addr; 
        #  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
        #  proxy_pass http://branch.followme.org:8011; 
         }}
      

  3.   

    改了端口?怎么没反应在 url 中?
      

  4.   

    不大懂你说的意思,(proxy_pass http://followme.gfline.com:8111/;)  这里是跳转到apache的监听端口了     
      

  5.   

    实际上地址还是显示的8087,后面那个8111是apache监听的,先是nginx监听8087,然后转给apache的8111;
      

  6.   

    我说的是为什么是 http“//ollowme.gfline.com/partner-recruitment.html
    为不是 http://ollowme.gfline.com:8087/partner-recruitment.html
      

  7.   

    http“//followme.gfline.com" 已经含有8087了,用的是隐形解析,