当前位置:论坛首页 > Linux面板 > 求助

【待反馈】苹果app内嵌webview报找不到站点

发表在 Linux面板2021-8-4 19:11 [复制链接] 5 2112

宝塔用nginx服务搭的网站,苹果app内嵌webview无法访问,报找不到站点,
苹果自带浏览器输入ip可以访问,安卓app内嵌webview可以访问,
这情况可能是什么原因?好几天了一直没解决,
nginx中配置了反向代理,指定/xxx目录接口到另外的ip,
使用道具 举报 只看该作者 回复
发表于 2021-8-4 19:20:00 | 显示全部楼层
这是报错信息,实际看了是nginx下的一个页面,
20200721205734942.png
使用道具 举报 回复 支持 反对
发表于 2021-8-4 19:22:05 | 显示全部楼层
nginx的request日志,
第一行是苹果app访问,第2,3行是苹果自带浏览器访问,
mmexport1628074789020.jpg
使用道具 举报 回复 支持 反对
发表于 2021-8-4 20:38:50 | 显示全部楼层
能否截图看看你反向代理配置
使用道具 举报 回复 支持 反对
发表于 2021-8-5 08:44:09 | 显示全部楼层
谢花郎 发表于 2021-8-4 20:38
能否截图看看你反向代理配置
  1. user  www www;
  2. worker_processes auto;
  3. error_log  /www/wwwlogs/nginx_error.log  crit;
  4. pid        /www/server/nginx/logs/nginx.pid;
  5. worker_rlimit_nofile 51200;

  6. events
  7.     {
  8.         use epoll;
  9.         worker_connections 51200;
  10.         multi_accept on;
  11.     }

  12. http
  13.     {
  14.         include       mime.types;
  15.                     #include luawaf.conf;
  16.    
  17.                     include proxy.conf;

  18.         default_type  application/octet-stream;

  19.         server_names_hash_bucket_size 512;
  20.         client_header_buffer_size 32k;
  21.         large_client_header_buffers 4 32k;
  22.         client_max_body_size 50m;

  23.         sendfile   on;
  24.         tcp_nopush on;

  25.         keepalive_timeout 60;

  26.         tcp_nodelay on;

  27.         fastcgi_connect_timeout 300;
  28.         fastcgi_send_timeout 300;
  29.         fastcgi_read_timeout 300;
  30.         fastcgi_buffer_size 64k;
  31.         fastcgi_buffers 4 64k;
  32.         fastcgi_busy_buffers_size 128k;
  33.         fastcgi_temp_file_write_size 256k;
  34.                     fastcgi_intercept_errors on;

  35.         gzip on;
  36.         gzip_min_length  1k;
  37.         gzip_buffers     4 16k;
  38.         gzip_http_version 1.1;
  39.         gzip_comp_level 2;
  40.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  41.         gzip_vary on;
  42.         gzip_proxied   expired no-cache no-store private auth;
  43.         gzip_disable   "MSIE [1-6]\.";

  44.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  45.                     limit_conn_zone $server_name zone=perserver:10m;

  46.         server_tokens off;
  47.         #test日志
  48.         #access_log off;
  49.         
  50.         log_format  main '$request';

  51. server
  52.     {
  53.         listen 888;
  54.         server_name phpmyadmin;
  55.         index index.html index.htm index.php;
  56.         root  /www/server/phpmyadmin;

  57.         #error_page   404   /404.html;
  58.         include enable-php.conf;

  59.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  60.         {
  61.             expires      30d;
  62.         }

  63.         location ~ .*\.(js|css)?$
  64.         {
  65.             expires      12h;
  66.         }

  67.         location ~ /\.
  68.         {
  69.             deny all;
  70.         }

  71.         access_log  /www/wwwlogs/access.log;
  72.     }
  73.    
  74. server
  75.     {
  76.         listen 80;
  77.         server_name 10.100.31.6;
  78.         #test start#
  79.         root /www/wwwroot/aaa;
  80.         index index.html;
  81.         #test end#
  82.         
  83.         #跨域转发,匹配所有路径以/kafka开头的请求
  84.         location ^~ /kafka {
  85.           #设置请求域名
  86.           proxy_set_header Host 10.100.31.6;
  87.           #设置想要转发的真实后端服务
  88.           proxy_pass http://10.100.31.35;  
  89.         }
  90.         
  91.         #跨域转发,匹配所有路径以/bwaaa开头的请求
  92.         location ^~ /bwaaa {
  93.           #设置请求域名
  94.           proxy_set_header Host 10.100.31.6;
  95.           #设置想要转发的真实后端服务
  96.           proxy_pass http://10.100.31.35;  
  97.         }
  98.         
  99.         location / {
  100.           #root /www/server/nginx/aaa;
  101.           root /www/wwwroot/aaa;
  102.           index index.html;
  103.          
  104.           # proxy_pass http://10.100.31.6/;
  105.           # #告诉浏览器允许跨域访问的方法
  106.           # add_header Access-Control-Allow-Methods *;
  107.           # # 告诉浏览器缓存OPTIONS预检请求1小时
  108.           # add_header Access-Control-Max-Age 3600;
  109.           # #允许带有cookie访问
  110.           # add_header Access-Control-Allow-Credentials true;
  111.           # #注意 * 不能满足带有cookie的访问,Origin 必须是全匹配,这里通过变量获取
  112.           # add_header Access-Control-Allow-Origin $http_origin;
  113.           # #设置支持所有的自定义请求头
  114.           # add_header Access-Control-Allow-Headers $http_access_control_request_headers;
  115.           # #如果预检请求,则返回成功,不需要转发到后端
  116.           # if ($request_method = OPTIONS){
  117.           #   return 200;
  118.           # }
  119.         }
  120.     }   
  121. include /www/server/panel/vhost/nginx/*.conf;
  122. }

复制代码
使用道具 举报 回复 支持 反对
发表于 2021-8-5 08:45:01 | 显示全部楼层
  1. user  www www;
  2. worker_processes auto;
  3. error_log  /www/wwwlogs/nginx_error.log  crit;
  4. pid        /www/server/nginx/logs/nginx.pid;
  5. worker_rlimit_nofile 51200;

  6. events
  7.     {
  8.         use epoll;
  9.         worker_connections 51200;
  10.         multi_accept on;
  11.     }

  12. http
  13.     {
  14.         include       mime.types;
  15.                     #include luawaf.conf;
  16.    
  17.                     include proxy.conf;

  18.         default_type  application/octet-stream;

  19.         server_names_hash_bucket_size 512;
  20.         client_header_buffer_size 32k;
  21.         large_client_header_buffers 4 32k;
  22.         client_max_body_size 50m;

  23.         sendfile   on;
  24.         tcp_nopush on;

  25.         keepalive_timeout 60;

  26.         tcp_nodelay on;

  27.         fastcgi_connect_timeout 300;
  28.         fastcgi_send_timeout 300;
  29.         fastcgi_read_timeout 300;
  30.         fastcgi_buffer_size 64k;
  31.         fastcgi_buffers 4 64k;
  32.         fastcgi_busy_buffers_size 128k;
  33.         fastcgi_temp_file_write_size 256k;
  34.                     fastcgi_intercept_errors on;

  35.         gzip on;
  36.         gzip_min_length  1k;
  37.         gzip_buffers     4 16k;
  38.         gzip_http_version 1.1;
  39.         gzip_comp_level 2;
  40.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  41.         gzip_vary on;
  42.         gzip_proxied   expired no-cache no-store private auth;
  43.         gzip_disable   "MSIE [1-6]\.";

  44.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  45.                     limit_conn_zone $server_name zone=perserver:10m;

  46.         server_tokens off;
  47.         #test日志
  48.         #access_log off;
  49.         
  50.         log_format  main '$request';

  51. server
  52.     {
  53.         listen 888;
  54.         server_name phpmyadmin;
  55.         index index.html index.htm index.php;
  56.         root  /www/server/phpmyadmin;

  57.         #error_page   404   /404.html;
  58.         include enable-php.conf;

  59.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  60.         {
  61.             expires      30d;
  62.         }

  63.         location ~ .*\.(js|css)?$
  64.         {
  65.             expires      12h;
  66.         }

  67.         location ~ /\.
  68.         {
  69.             deny all;
  70.         }

  71.         access_log  /www/wwwlogs/access.log;
  72.     }
  73.    
  74. server
  75.     {
  76.         listen 80;
  77.         server_name 10.100.31.6;
  78.         #test start#
  79.         root /www/wwwroot/aaa;
  80.         index index.html;
  81.         #test end#
  82.         
  83.         #跨域转发,匹配所有路径以/kafka开头的请求
  84.         location ^~ /kafka {
  85.           #设置请求域名
  86.           proxy_set_header Host 10.100.31.6;
  87.           #设置想要转发的真实后端服务
  88.           proxy_pass http://10.100.31.35;  
  89.         }
  90.         
  91.         #跨域转发,匹配所有路径以/bwaaa开头的请求
  92.         location ^~ /bwaaa {
  93.           #设置请求域名
  94.           proxy_set_header Host 10.100.31.6;
  95.           #设置想要转发的真实后端服务
  96.           proxy_pass http://10.100.31.35;  
  97.         }
  98.         
  99.         location / {
  100.           #root /www/server/nginx/aaa;
  101.           root /www/wwwroot/aaa;
  102.           index index.html;
  103.          
  104.           # proxy_pass http://10.100.31.6/;
  105.           # #告诉浏览器允许跨域访问的方法
  106.           # add_header Access-Control-Allow-Methods *;
  107.           # # 告诉浏览器缓存OPTIONS预检请求1小时
  108.           # add_header Access-Control-Max-Age 3600;
  109.           # #允许带有cookie访问
  110.           # add_header Access-Control-Allow-Credentials true;
  111.           # #注意 * 不能满足带有cookie的访问,Origin 必须是全匹配,这里通过变量获取
  112.           # add_header Access-Control-Allow-Origin $http_origin;
  113.           # #设置支持所有的自定义请求头
  114.           # add_header Access-Control-Allow-Headers $http_access_control_request_headers;
  115.           # #如果预检请求,则返回成功,不需要转发到后端
  116.           # if ($request_method = OPTIONS){
  117.           #   return 200;
  118.           # }
  119.         }
  120.     }   
  121. include /www/server/panel/vhost/nginx/*.conf;
  122. }

复制代码
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表